C++ components not logging when deployed with rttlua

Dear Orocos folks,

I am just getting started with using rttlua for deployment, and am having
trouble with logging/error reporting.

Our C++ components throw errors using stuff like:

log( Error ) << "Crashing because foobar!" << endlog;

In deployer-gnulnux I see the error messages, but in rttlua the errors are
silent. Nothing is printed to the screen, and the errors aren't printed to
orocos.log either.

Do I need to upgrade all of our components to the new real-time logging
stuff for logging to work in rttlua? We are not currently doing any
logging in real-time sections of our code at all; I just need to see why my
code is crashing when deployed by rttlua.

Writing log messages from lua does work:
rtt.logl("Info", "Loading PLANEPOWER components...")

There are also a slew of other Info and Warning messages getting output to
orocos.log.

Am I missing some magic incantations in my lua deployment script or
something? Here is the relevant section of my lua deployment script:

require("rttlib")
rtt.setLogLevel("Warning")
rttlib.color = true
tc = rtt.getTC()
deployer = tc:getPeer("Deployer")
rtt.logl("Info", "Loading PLANEPOWER components...")
deployer:import("ocl")
deployer:import("simpleTrajectoryGenerator")
deployer:loadComponent("trajectoryGenerator","SimpleTrajectoryGenerator")
trajectoryGenerator=deployer:getPeer("trajectoryGenerator")

Cheers,
Andrew

C++ components not logging when deployed with rttlua

Hi Andrew,

On Thu, Apr 04, 2013 at 04:04:49PM +0200, Andrew Wagner wrote:
> Dear Orocos folks,
> I am just getting started with using rttlua for deployment, and am having
> trouble with logging/error reporting.
> Our C++ components throw errors using stuff like:
> log( Error ) << "Crashing because foobar!" << endlog;
> In deployer-gnulnux I see the error messages, but in rttlua the errors are
> silent. Nothing is printed to the screen, and the errors aren't printed to
> orocos.log either.

Hmm, odd. Does your process live long enough after writing the error
for it to make it to stdout?

> Do I need to upgrade all of our components to the new real-time logging stuff
> for logging to work in rttlua? We are not currently doing any logging in
> real-time sections of our code at all; I just need to see why my code is
> crashing when deployed by rttlua.

No, you don't need to upgrade. Normally this should work.

> Writing log messages from lua does work:
> rtt.logl("Info", "Loading PLANEPOWER components...")
> There are also a slew of other Info and Warning messages getting output to
> orocos.log.
> Am I missing some magic incantations in my lua deployment script or something?
> Here is the relevant section of my lua deployment script:
> require("rttlib")
> rtt.setLogLevel("Warning")
> rttlib.color = true
> tc = rtt.getTC()
> deployer = tc:getPeer("Deployer")
> rtt.logl("Info", "Loading PLANEPOWER components...")
> deployer:import("ocl")
> deployer:import("simpleTrajectoryGenerator")
> deployer:loadComponent("trajectoryGenerator","SimpleTrajectoryGenerator")
> trajectoryGenerator=deployer:getPeer("trajectoryGenerator")

No idea, really. Which orocos_toolchain version are you using?

Markus

C++ components not logging when deployed with rttlua

On Thu, Apr 4, 2013 at 4:32 PM, Markus Klotzbuecher <
markus [dot] klotzbuecher [..] ...> wrote:

> Hmm, odd. Does your process live long enough after writing the error
> for it to make it to stdout?

Yes; I observe the same behavior when running with rtlua -i foo.lua

> No idea, really. Which orocos_toolchain version are you using?
>
>
Not sure, but it's recent. It looks like I ran the orocos bootstrap script
some time after Jan. 24; the ocl git repo that the ruby scripts checked out
is at:

3264d28d89caf5afcb23175bd6f39b744e3617d6

$ cat NEWS
Orocos Components Library (OCL) v2.0.0+

C++ components not logging when deployed with rttlua

2013/4/4 Andrew Wagner <andrew [dot] wagner [..] ...>

> On Thu, Apr 4, 2013 at 4:32 PM, Markus Klotzbuecher <
> markus [dot] klotzbuecher [..] ...> wrote:
>
>> Hmm, odd. Does your process live long enough after writing the error
>> for it to make it to stdout?
>
>
> Yes; I observe the same behavior when running with rtlua -i foo.lua
>
>
>> No idea, really. Which orocos_toolchain version are you using?
>>
>>
> Not sure, but it's recent. It looks like I ran the orocos bootstrap
> script some time after Jan. 24; the ocl git repo that the ruby scripts
> checked out is at:
>
> 3264d28d89caf5afcb23175bd6f39b744e3617d6
>
> $ cat NEWS
> Orocos Components Library (OCL) v2.0.0+
>
>
you'd better use something like :
"deployer-gnulinux --version"
or if you are using ROS :
"rosrun ocl deployer-gnulinux --version"

>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>

C++ components not logging when deployed with rttlua

On Thu, Apr 4, 2013 at 6:35 PM, Willy Lambert <lambert [dot] willy [..] ...>wrote:

> you'd better use something like :
> "deployer-gnulinux --version"
> or if you are using ROS :
> "rosrun ocl deployer-gnulinux --version"
>

ok, then it looks like I'm at API version 2.6.0

$ deployer-gnulinux --version
OROCOS Toolchain version '2.6.0' ( GCC 4.6.3 ) -- GNU/Linux.

thanks!

C++ components not logging when deployed with rttlua

I still have not figured out why logging isn't working for me in rtlua. Is
there anyone besides me using rtlua and (non-rt) logging?

My environment is non-standard in the sense that I'm not using ROS, and I
built my components with tup instead of CMake, but logging is working with
the same build of the components and deployer-gnulinux, so I suspect this
is some sort of configuration problem with rtlua.

Does rtlua have any codepath that relies on ROS for anything logging
related? Maybe querying ROS for a path for a logger component or default
log path or something? I can go dig into the rtlua code, but maybe someone
just knows.

Cheers,
Andrew

On Thu, Apr 4, 2013 at 7:00 PM, Andrew Wagner <
andrew [dot] wagner [..] ...> wrote:

> On Thu, Apr 4, 2013 at 6:35 PM, Willy Lambert <lambert [dot] willy [..] ...>wrote:
>
>> you'd better use something like :
>> "deployer-gnulinux --version"
>> or if you are using ROS :
>> "rosrun ocl deployer-gnulinux --version"
>>
>
> ok, then it looks like I'm at API version 2.6.0
>
> $ deployer-gnulinux --version
> OROCOS Toolchain version '2.6.0' ( GCC 4.6.3 ) -- GNU/Linux.
>
> thanks!
>

C++ components not logging when deployed with rttlua

Hi Andrew,

On Mon, Apr 08, 2013 at 07:25:30PM +0200, Andrew Wagner wrote:
> I still have not figured out why logging isn't working for me in rtlua. Is
> there anyone besides me using rtlua and (non-rt) logging?

Yes, I've used it before.

> My environment is non-standard in the sense that I'm not using ROS, and I built
> my components with tup instead of CMake, but logging is working with the same
> build of the components and deployer-gnulinux, so I suspect this is some sort of
> configuration problem with rtlua.
> Does rtlua have any codepath that relies on ROS for anything logging
> related?
> Maybe querying ROS for a path for a logger component or default log path or
> something? I can go dig into the rtlua code, but maybe someone just knows.

No, there is no dependency on ROS.

Best regards
Markus

Ruben Smits's picture

C++ components not logging when deployed with rttlua

Hi Andrew,

I'm using rttlua and logging on a daily basis without a glitch, have you
tried increasing the loglevel to Debug, just to make sure that it is not
the case that the example just does not hit any path of your code
containing the logging statements?

try `export ORO_LOGLEVEL=7` before you launch rttlua, it should print out a
bunch of debug messages now:

im-desktop-01 ~ $ export ORO_LOGLEVEL=7
im-desktop-01 ~ $ rttlua
0.000 [ Info ][Logger] Successfully extracted environment variable
ORO_LOGLEVEL
0.000 [ Info ][Logger] OROCOS version '2.6.0' compiled with GCC 4.6.3.
Running in GNU/Linux.
0.000 [ Info ][Logger] Orocos Logging Activated at level : [ Debug ] ( 6
)
0.000 [ Info ][Logger] Reference System Time is : 1365502893644714908
ticks ( 1.3655e+09 seconds ).
0.000 [ Info ][Logger] Logging is relative to this time.
0.000 [ Debug ][Logger] MainThread started.
0.000 [ Debug ][Logger] Starting StartStopManager.
....

Ruben

Ruben Smits, Phd
Chief Technology Officer
Intermodalics BVBA
+32479511786
www.intermodalics.eu

On Tue, Apr 9, 2013 at 10:30 AM, Markus Klotzbuecher <
markus [dot] klotzbuecher [..] ...> wrote:

> Hi Andrew,
>
> On Mon, Apr 08, 2013 at 07:25:30PM +0200, Andrew Wagner wrote:
> > I still have not figured out why logging isn't working for me in rtlua.
> Is
> > there anyone besides me using rtlua and (non-rt) logging?
>
> Yes, I've used it before.
>
> > My environment is non-standard in the sense that I'm not using ROS, and
> I built
> > my components with tup instead of CMake, but logging is working with the
> same
> > build of the components and deployer-gnulinux, so I suspect this is some
> sort of
> > configuration problem with rtlua.
> > Does rtlua have any codepath that relies on ROS for anything logging
> > related?
> > Maybe querying ROS for a path for a logger component or default log
> path or
> > something? I can go dig into the rtlua code, but maybe someone just
> knows.
>
> No, there is no dependency on ROS.
>
> Best regards
> Markus
>
>
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>