Problems with <strike>LUA</strike> Orocos Script ( logger properties & load components)

Dear Markus,

While I test it with LUA, I try to test the same on Orocos Scripting and I
found another strange error, in the next lines I described my steps to
reproduce it:

IF :

1 - load an XML configuration deplotyer file with* my components +
OCL::logging::LoggerService + OCL::logging::FileAppender* correctly.
2 - write properties using marshall service for each logging component ,
the output was:

* OCL::logging::LoggerService *(as logger_services.xml)
*
*

<?xml version="1.0" encoding="UTF-8"?>

&lt;!DOCTYPE properties SYSTEM "cpf.dtd"&gt;

<properties>

<struct name="Levels" type="PropertyBag">

<description>A PropertyBag defining the level of each category of
interest.<description>

<simple name="ugv.core" type="string"><value>debug<value><simple>

<struct>

<struct name="Appenders" type="PropertyBag">

<description>A PropertyBag defining the appenders for each category of
interest.<description>

<simple name="ugv.core" type="string"><value>*AppenderA*
<value><simple>

<struct>

<properties>

* OCL::logging::FileAppender* ( as logger_appenders.xml)

<?xml version="1.0" encoding="UTF-8"?>

&lt;!DOCTYPE properties SYSTEM "cpf.dtd"&gt;

<properties>

<simple name="LayoutName" type="string"><description>Layout name (e.g.
'simple', 'pattern')<description><value>pattern<value><simple>

<simple name="LayoutPattern" type="string"><description>Layout conversion
pattern (for those layouts that use a pattern)<description><value>%d [%t]
%-5p %c %x - %m%n<value><simple>

<simple name="Filename" type="string"><description>Name of file to log
to<description><value>log/Command.log<value><simple>

<simple name="MaxEventsPerCycle" type="long"><description>Maximum number
of log events to pop per cycle<description><value>0<value><simple>

<properties>

3.- quit from deployer

4.- generate an Orocos Scripting :

import("rtt");

import("orocos/ocl");

loadComponent("*aa*", "OCL::logging::FileAppender");

loadComponent("*logS*", "OCL::logging::LoggingService");

aa.setPeriod(0.5);

logS.setPeriod(0.5);

addPeer("aa","logS");

loadService("logS","marshalling");

loadService("aa","marshalling");

logS.marshalling.loadProperties("/development/apps/ugv/core/commands/logger_services.xml");

aa.marshalling.loadProperties("/development/apps/ugv/core/commands/logger_appenders.xml");

aa.configure()

logS.configure()

aa.start()

logS.start()

// ... next lines load Components.

5.- when execute this OPS: deployer-gnulinux -s test.ops, it launch an
error:

0.083 [ ERROR ][ScriptingService] Could not find appender 'AppenderA'

THEN :

My components are not avalaible to use the loggers:

Peers : CommandController[*S*] CommandTest[*S*] *aa[R] logS[U] *

If I execute the same components from my test XML configuration file, the
status of the components are correct and the logging service is sucessfully
working:

Peers : AppenderFile[*R*] InputTestCommand[*R*] LoggingService[*R*]
MyCommand[*R*]

I'm surprised that the load properties from files generated from the "same"
configuration generate a different execution when it is instanced from
Oorocos Script or from XML-configuration file.

Any ideas? solutions? I'm using : OROCOS Toolchain version '2.4.0' ( GCC
4.4.3 ) -- GNU/Linux.

Thanks in advance,
Toni.

Problems with <strike>LUA</strike> Orocos Script ( logger proper

Toni,

On Fri, Nov 25, 2011 at 12:01 PM, Antonio Castellon
<antonio [dot] castellon [..] ...> wrote:
> Dear Markus,
>
> While I test it with LUA, I try to test the same on Orocos Scripting and I
> found another strange error, in the next lines I described my steps to
> reproduce it:
>
> IF :
>
> 1 - load an XML configuration deplotyer file with my components +
>  OCL::logging::LoggerService + OCL::logging::FileAppender correctly.
> 2 - write properties using marshall service for each logging component , the
> output was:
>
>  OCL::logging::LoggerService (as logger_services.xml)
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> &lt;!DOCTYPE properties SYSTEM "cpf.dtd"&gt;
>
> <properties>
>
>   <struct name="Levels" type="PropertyBag">
>
>      <description>A PropertyBag defining the level of each category of
> interest.<description>
>
>      <simple name="ugv.core" type="string"><value>debug<value><simple>
>
>   <struct>
>
>   <struct name="Appenders" type="PropertyBag">
>
>      <description>A PropertyBag defining the appenders for each category of
> interest.<description>
>
>      <simple name="ugv.core" type="string"><value>AppenderA<value><simple>

This should be: <value>aa<value>

>
>   <struct>
>
> <properties>
>
>
>  OCL::logging::FileAppender  ( as logger_appenders.xml)
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> &lt;!DOCTYPE properties SYSTEM "cpf.dtd"&gt;
>
> <properties>
>
>   <simple name="LayoutName" type="string"><description>Layout name (e.g.
> 'simple', 'pattern')<description><value>pattern<value><simple>
>
>   <simple name="LayoutPattern" type="string"><description>Layout conversion
> pattern (for those layouts that use a pattern)<description><value>%d [%t]
> %-5p %c %x - %m%n<value><simple>
>
>   <simple name="Filename" type="string"><description>Name of file to log
> to<description><value>log/Command.log<value><simple>
>
>   <simple name="MaxEventsPerCycle" type="long"><description>Maximum number
> of log events to pop per cycle<description><value>0<value><simple>
>
> <properties>
>
>
> 3.- quit from deployer
>
> 4.- generate an Orocos Scripting :
>
>
> import("rtt");
>
> import("orocos/ocl");
>
>
> loadComponent("aa", "OCL::logging::FileAppender");
>
> loadComponent("logS", "OCL::logging::LoggingService");
>
>
> aa.setPeriod(0.5);
>
> logS.setPeriod(0.5);
>
>
>
> addPeer("aa","logS");

This should be:

addPeer("logS", "aa")

It's from logS TO aa. In your script, aa knows logS, but it must be
the other way around.

>
>
> loadService("logS","marshalling");
>
> loadService("aa","marshalling");
>
>
> logS.marshalling.loadProperties("/development/apps/ugv/core/commands/logger_services.xml");
>
> aa.marshalling.loadProperties("/development/apps/ugv/core/commands/logger_appenders.xml");
>
>
> aa.configure()
>
> logS.configure()
>
>
>
> aa.start()
>
> logS.start()
>
> // ... next lines load Components.
>
>
> 5.- when execute this OPS: deployer-gnulinux -s test.ops, it launch an
> error:
>
> 0.083 [ ERROR  ][ScriptingService] Could not find appender 'AppenderA'

The error could indeed clarify that it can't find AppenderA as a peer
of the logging service,
which should have rung a bell.

Peter

Problems with <strike>LUA</strike> Orocos Script ( logger proper

On Nov 25, 2011, at 06:01 , Antonio Castellon wrote:

> Dear Markus,
>
> While I test it with LUA, I try to test the same on Orocos Scripting and I found another strange error, in the next lines I described my steps to reproduce it:
>
> IF :
> 1 - load an XML configuration deplotyer file with my components + OCL::logging::LoggerService + OCL::logging::FileAppender correctly.
> 2 - write properties using marshall service for each logging component , the output was:
>
> OCL::logging::LoggerService (as logger_services.xml)
>
> <?xml version="1.0" encoding="UTF-8"?>
> &lt;!DOCTYPE properties SYSTEM "cpf.dtd"&gt;
> <properties>
> <struct name="Levels" type="PropertyBag">
> <description>A PropertyBag defining the level of each category of interest.<description>
> <simple name="ugv.core" type="string"><value>debug<value><simple>
> <struct>
> <struct name="Appenders" type="PropertyBag">
> <description>A PropertyBag defining the appenders for each category of interest.<description>
> <simple name="ugv.core" type="string"><value>AppenderA<value><simple>
> <struct>
> <properties>
>
> OCL::logging::FileAppender ( as logger_appenders.xml)
>
> <?xml version="1.0" encoding="UTF-8"?>
> &lt;!DOCTYPE properties SYSTEM "cpf.dtd"&gt;
> <properties>
> <simple name="LayoutName" type="string"><description>Layout name (e.g. 'simple', 'pattern')<description><value>pattern<value><simple>
> <simple name="LayoutPattern" type="string"><description>Layout conversion pattern (for those layouts that use a pattern)<description><value>%d [%t] %-5p %c %x - %m%n<value><simple>
> <simple name="Filename" type="string"><description>Name of file to log to<description><value>log/Command.log<value><simple>
> <simple name="MaxEventsPerCycle" type="long"><description>Maximum number of log events to pop per cycle<description><value>0<value><simple>
> <properties>
>
> 3.- quit from deployer
>
> 4.- generate an Orocos Scripting :
>
> import("rtt");
> import("orocos/ocl");
>
> loadComponent("aa", "OCL::logging::FileAppender");
> loadComponent("logS", "OCL::logging::LoggingService");
>
> aa.setPeriod(0.5);
> logS.setPeriod(0.5);
>
> addPeer("aa","logS");
>
> loadService("logS","marshalling");
> loadService("aa","marshalling");
>
> logS.marshalling.loadProperties("/development/apps/ugv/core/commands/logger_services.xml");
> aa.marshalling.loadProperties("/development/apps/ugv/core/commands/logger_appenders.xml");
>
> aa.configure()
> logS.configure()
>
> aa.start()
> logS.start()
>
> // ... next lines load Components.
>
> 5.- when execute this OPS: deployer-gnulinux -s test.ops, it launch an error:
>
> 0.083 [ ERROR ][ScriptingService] Could not find appender 'AppenderA'
>
>
> THEN :
>
> My components are not avalaible to use the loggers:
>
> Peers : CommandController[S] CommandTest[S] aa[R] logS[U]
>
>
> If I execute the same components from my test XML configuration file, the status of the components are correct and the logging service is sucessfully working:
>
> Peers : AppenderFile[R] InputTestCommand[R] LoggingService[R] MyCommand[R]
>
>
> I'm surprised that the load properties from files generated from the "same" configuration generate a different execution when it is instanced from Oorocos Script or from XML-configuration file.
>
>
> Any ideas? solutions? I'm using : OROCOS Toolchain version '2.4.0' ( GCC 4.4.3 ) -- GNU/Linux.
>
>
> Thanks in advance,
> Toni.
>
Looks to me that you renamed the "AppenderA" component to "aa" with the loadComponent("aa"... statement ...
S

enkulator's picture

Problems with <strike>LUA</strike> Orocos Script ( logger proper

No it is not the problem, I change for "aa" and the response is the same.
:-(
nobody has test it on another environment?

Regards
Toni

Problems with <strike>LUA</strike> Orocos Script ( logger proper

2011/11/25 Antonio Castellon <antonio [dot] castellon [..] ...>:
> No it is not the problem, I change for "aa" and the response is the same.
> :-(

There is no AppenderA in the script. Can you show us the whole script?

Steven

> nobody has test it on another environment?
> Regards
> Toni