[Bug 538] New: Unable specify log level when starting deployer

For more infomation about this bug, visit
Summary: Unable specify log level when starting deployer
Product: OCL
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P2
Component: Deployment
AssignedTo: orocos-dev [..] ...
ReportedBy: kiwi [dot] net [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Want to be able to specify the log level of the deployer application at startup
e.g.

deployer-gnulinux --log=DEBUG

or

deployer-gnulinux --log=Info

etc.

Would anyone be against using the boost::program_options library to do this?
Replacing the existing command line parsing would be trivial with this library
also.

Cheers
S

[Bug 538] Unable specify log level when starting deployer

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=538

--- Comment #21 from Klaas Gadeyne <klaas [dot] gadeyne [..] ...> 2009-06-19 09:11:28 ---
As this one is still ¨reopened":

Yesterday, I spent half an hour debugging looking why ORO_LOGLEVEL wasn't
respected by the deployment component. I didn't find anything in
<http://www.orocos.org/stable/documentation/ocl/v1.8.x/api/html/classOCL_1_1DeploymentComponent.html>
nor in
<http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-deployment.html>
about this option. Then I came to the conclusion that reading docs is not
useful,
<look for hidden ad>
only grepping the OCL source works
</>

I was running an application I got from someone who was so kind to provide me a
oneliner bash script stating "deployer-blabla -linfo". Unfortunately, I didn't
look close to the script statements.

Therefore, please leave reopened until docs are updated about the command line
options op the DC. If it's only about the loglevel, I wanna give it a first
try, but maybe someone else (hint, Stephen :-) is more appropriate.

[Bug 538] Unable specify log level when starting deployer

On Jun 19, 2009, at 03:11 , Klaas Gadeyne wrote:

> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=538
>
> --- Comment #21 from Klaas Gadeyne <klaas [dot] gadeyne [..] ...>
> 2009-06-19 09:11:28 ---
> As this one is still ¨reopened":
>
> Yesterday, I spent half an hour debugging looking why ORO_LOGLEVEL
> wasn't
> respected by the deployment component. I didn't find anything in
> <http://www.orocos.org/stable/documentation/ocl/v1.8.x/api/html/classOCL_1_1DeploymentComponent.html
> >
> nor in
> <http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-deployment.html
> >
> about this option. Then I came to the conclusion that reading docs
> is not
> useful,
> <look for hidden ad>
> only grepping the OCL source works
> </>
>
> I was running an application I got from someone who was so kind to
> provide me a
> oneliner bash script stating "deployer-blabla -linfo".
> Unfortunately, I didn't
> look close to the script statements.
>
> Therefore, please leave reopened until docs are updated about the
> command line
> options op the DC. If it's only about the loglevel, I wanna give it
> a first
> try, but maybe someone else (hint, Stephen :-) is more appropriate.

Hmmm mea culpa ... where do you think additional documentation should
go? This page

http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-dep...

or just leave it within the deployer and maybe make the option
descriptions more verbose?

That web page doesn't mention how to run the deployer(s) at all, which
is something we probably should change. Am I correct in saying that
the ocl/doc/xml/orocos-deployment.xml file is used to generate that
web page?

Cheers
Stephen

[Bug 538] Unable specify log level when starting deployer

On Fri, Jun 19, 2009 at 14:00, S Roderick<kiwi [dot] net [..] ...> wrote:
> On Jun 19, 2009, at 03:11 , Klaas Gadeyne wrote:
>
>> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=538
>>
>> --- Comment #21 from Klaas Gadeyne <klaas [dot] gadeyne [..] ...>
>> 2009-06-19 09:11:28 ---
>> As this one is still ¨reopened":
>>
>> Yesterday, I spent half an hour debugging looking why ORO_LOGLEVEL
>> wasn't
>> respected by the deployment component.  I didn't find anything in
>> <http://www.orocos.org/stable/documentation/ocl/v1.8.x/api/html/classOCL_1_1DeploymentComponent.html
>> >
>> nor in
>> <http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-deployment.html
>> >
>> about this option.  Then I came to the conclusion that reading docs
>> is not
>> useful,
>> <look for hidden ad>
>> only grepping the OCL source works
>> </>
>>
>> I was running an application I got from someone who was so kind to
>> provide me a
>> oneliner bash script stating "deployer-blabla -linfo".
>> Unfortunately, I didn't
>> look close to the script statements.
>>
>> Therefore, please leave reopened until docs are updated about the
>> command line
>> options op the DC.  If it's only about the loglevel, I wanna give it
>> a first
>> try, but maybe someone else (hint, Stephen :-) is more appropriate.
>
> Hmmm mea culpa ... where do you think additional documentation should
> go? This page
>
> http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-dep...
>
> or just leave it within the deployer and maybe make the option
> descriptions more verbose?
>
> That web page doesn't mention how to run the deployer(s) at all, which
> is something we probably should change. Am I correct in saying that
> the ocl/doc/xml/orocos-deployment.xml file is used to generate that
> web page?

Yes. There's already a section about starting the deployer application.

Peter

[Bug 538] Unable specify log level when starting deployer

On Jun 19, 2009, at 08:30 , Peter Soetens wrote:

> On Fri, Jun 19, 2009 at 14:00, S Roderick<kiwi [dot] net [..] ...> wrote:
>> On Jun 19, 2009, at 03:11 , Klaas Gadeyne wrote:
>>
>>> https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=538
>>>
>>> --- Comment #21 from Klaas Gadeyne <klaas [dot] gadeyne [..] ...>
>>> 2009-06-19 09:11:28 ---
>>> As this one is still ¨reopened":
>>>
>>> Yesterday, I spent half an hour debugging looking why ORO_LOGLEVEL
>>> wasn't
>>> respected by the deployment component. I didn't find anything in
>>> <http://www.orocos.org/stable/documentation/ocl/v1.8.x/api/html/classOCL_1_1DeploymentComponent.html
>>>>
>>> nor in
>>> <http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-deployment.html
>>>>
>>> about this option. Then I came to the conclusion that reading docs
>>> is not
>>> useful,
>>> <look for hidden ad>
>>> only grepping the OCL source works
>>> </>
>>>
>>> I was running an application I got from someone who was so kind to
>>> provide me a
>>> oneliner bash script stating "deployer-blabla -linfo".
>>> Unfortunately, I didn't
>>> look close to the script statements.
>>>
>>> Therefore, please leave reopened until docs are updated about the
>>> command line
>>> options op the DC. If it's only about the loglevel, I wanna give it
>>> a first
>>> try, but maybe someone else (hint, Stephen :-) is more appropriate.
>>
>> Hmmm mea culpa ... where do you think additional documentation should
>> go? This page
>>
>> http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-dep...
>>
>> or just leave it within the deployer and maybe make the option
>> descriptions more verbose?
>>
>> That web page doesn't mention how to run the deployer(s) at all,
>> which
>> is something we probably should change. Am I correct in saying that
>> the ocl/doc/xml/orocos-deployment.xml file is used to generate that
>> web page?
>
> Yes. There's already a section about starting the deployer
> application.

How about the attached?

Warning, I can't build the doc's on my Mac so I am certain that there
are typo's in the attached. Seems there is some illegal option used by
CMake. Don't remember this happening before, but I'll look into it.

Stephen

[Bug 538] Unable specify log level when starting deployer

On Fri, Jun 19, 2009 at 15:32, Stephen Roderick<kiwi [dot] net [..] ...> wrote:
>>> That web page doesn't mention how to run the deployer(s) at all, which
>>> is something we probably should change. Am I correct in saying that
>>> the ocl/doc/xml/orocos-deployment.xml file is used to generate that
>>> web page?
>>
>> Yes. There's already a section about starting the deployer application.
>
> How about the attached?
>
> Warning, I can't build the doc's on my Mac so I am certain that there are
> typo's in the attached. Seems there is some illegal option used by CMake.
> Don't remember this happening before, but I'll look into it.

Reviewed, fixed and applied on svn/trunk.

Peter

[Bug 538] Unable specify log level when starting deployer

[...]
>> Therefore, please leave reopened until docs are updated about the
>> command line
>> options op the DC.  If it's only about the loglevel, I wanna give it
>> a first
>> try, but maybe someone else (hint, Stephen :-) is more appropriate.
>
> Hmmm mea culpa ... where do you think additional documentation should
> go? This page
>
> http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-dep...
>
> or just leave it within the deployer and maybe make the option
> descriptions more verbose?

I prefer the former since I think the option descriptions are verbose
enough, and 2 somehow I didn't have the reflex to run a -help on an
orocos program.
Indeed, now section 1.2 of the former docu page mentions the -start
options but not the other options.

> That web page doesn't mention how to run the deployer(s) at all, which
> is something we probably should change.

Well, you could argue that section 1.2 mentions is very briefly :-)
And admitted, it _does_ mention that there's a --help option (which I
overlooked yesterday :-( Shame on me!
Maybe part of my problem originated in the fact that the CLI overrides
the environment value without warning...

Am I correct in saying that
> the ocl/doc/xml/orocos-deployment.xml file is used to generate that
> web page?

Yep

Thx,

Klaas

[Bug 538] Unable specify log level when starting deployer

On Jun 19, 2009, at 08:22 , Klaas Gadeyne wrote:

> [...]
>>> Therefore, please leave reopened until docs are updated about the
>>> command line
>>> options op the DC. If it's only about the loglevel, I wanna give it
>>> a first
>>> try, but maybe someone else (hint, Stephen :-) is more appropriate.
>>
>> Hmmm mea culpa ... where do you think additional documentation should
>> go? This page
>>
>> http://www.orocos.org/stable/documentation/ocl/v1.8.x/doc-xml/orocos-dep...
>>
>> or just leave it within the deployer and maybe make the option
>> descriptions more verbose?
>
> I prefer the former since I think the option descriptions are verbose
> enough, and 2 somehow I didn't have the reflex to run a -help on an
> orocos program.
> Indeed, now section 1.2 of the former docu page mentions the -start
> options but not the other options.

I would advocate adding "1.3 Running the Orocos Applications" and
describe the options in there.

>> That web page doesn't mention how to run the deployer(s) at all,
>> which
>> is something we probably should change.
>
> Well, you could argue that section 1.2 mentions is very briefly :-)
> And admitted, it _does_ mention that there's a --help option (which I
> overlooked yesterday :-( Shame on me!
> Maybe part of my problem originated in the fact that the CLI overrides
> the environment value without warning...

That is true, and I'm not a fan of those kind of silent overrides.
Wouldn't take much to add a warning in the deployer/taskbrowser/etc
that the cmd-line option is overriding the env. var. That might help
with this frustrating "waste of time tracking down nothing"
experience. Also, given the way the programs are structured the log
will output a line indicating logging at whatever level the env. var.
sets, then the cmd-line option will sliently override it and future
log entries won't match. Probably the warning should be in the log
file and not to the console.

Stephen

[Bug 538] Unable specify log level when starting deployer

On Fri, Jun 19, 2009 at 08:33:20AM -0400, Stephen Roderick wrote:
> On Jun 19, 2009, at 08:22 , Klaas Gadeyne wrote:

> > Well, you could argue that section 1.2 mentions is very briefly :-)
> > And admitted, it _does_ mention that there's a --help option (which I
> > overlooked yesterday :-( Shame on me!
> > Maybe part of my problem originated in the fact that the CLI overrides
> > the environment value without warning...
>
> That is true, and I'm not a fan of those kind of silent overrides.

However this is common practice (at least under Unix) to have switches
override environment variables which again often override
dot-files. Its useful for occasionally overriding defaults.

> Wouldn't take much to add a warning in the deployer/taskbrowser/etc
> that the cmd-line option is overriding the env. var. That might help

A warning wouldn't really hurt although i think its needless. The
lesson here is to not run other peoples scripts without looking at
them :-)

Markus

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #20 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-08-13 13:18:25 ---
$ svn ci -m"Applied patch for bug #538: Unable specify log level when starting
deployer"
Sending bin/cdeployer.cpp
Sending bin/ctaskbrowser.cpp
Sending bin/deployer-corba.cpp
Sending bin/deployer-funcs.cpp
Sending bin/deployer-funcs.hpp
Sending bin/deployer.cpp
Transmitting file data ......
Committed revision 29488.

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

Peter Soetens

<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Attachment #301 is|0 |1
obsolete| |

--- Comment #19 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-08-13 13:17:14 ---
Created an attachment (id=337)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=337)
patch for trunk/ocl setting loglevels

This patch contains the changes to be committed on trunk. It adds the
--no-consolelog flag and passes extra options after -- to TAO.
Also the license is updated.

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #18 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-06-10 23:25:52 ---
Applied on trunk/rtt. This should open the road for a clean deployer patch.

$ svn ci src/Logger.* -m"Fixes for bug# 538: Unable specify log level when
starting deployer
> Applied Logger patch (#315) on RTT
> "
Sending src/Logger.cpp
Sending src/Logger.hpp
Sending src/Logger.inl
Transmitting file data ...
Committed revision 29385.

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #17 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-06-04 16:32:14 ---
Created an attachment (id=315)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=315)
adds two methods for enabling/disabling logging to file/stdout

Straightforward setter methods added.

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

Peter Soetens

<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |

--- Comment #16 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-06-04 16:30:43 ---
I'll reopen this as it's still work in progress...

(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #13)
> > > Created an attachment (id=301)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=301) [details] [details] [details]
> > > Refined patch
> > >
> > > Cleaner patch. More capable use of boost program options (now returns variable
> > > map to caller)
> > >
> > > Consolidates cdeployer and deployer-corba into cdeployer (removes need for
> > > deployer-corba).
> >
> > I'm still thinking about this solution. It's one program less, but the default
> > behavior of cdeployer changes from 'daemon' (no console) to console based.
> > That breaks some scripts probably... On the other hand, I like the fact that
> > only the server side needs an extra option such that 'console' usage causes
> > less type work (a sane default).
>
> Agreed. You decide. If it potentially breaks stuff, make it part of the v1.6
> release?

I was thinking 1.6. I still have to consider if it's worse to change the
behaviour of a program from 'deamon' to 'console' or to rename the program
alltogether. Possibilities for the variations could be 'cdeployerd',
'cdeployer-tb',...

>
> > > Adds option to cdeployer to either run corba server (ie original behaviour), or
> > > run taskbrowser with corba (ala deployer-corba).
> > >
> > > Adds option to turn off console logging
> >
> > This is not a 'perfect' implementation. I'd prefer to have a method that tells
> > the logger to disable console logging, then to redirect it to a stringstream...
> > We could check for 'stdoutput' not being null or an extra flag in
> > maylogStdOut().
>
> If you like, I can take a whack at this one ...?

No need to, 'done it already...

>
> > > NB the code to monkey with argc/argv is still not pretty ... :-(
> > >
> >
> > I'm not sure that you can do it better... Does it matter for TAO what argv[0]
> > contains ? I would just have passed to InitOrb(argc - taoIndex, argv[taoIndex]
> > )...and drop taoArgc and taoArgv calculations. Just a guess.
>
> The only thought is if TAO prints usage on an error, and includes the program
> name. I didn't want to confuse the user in this case, by having an incorrect
> "argv[0]".

I don't think TAO reads argv[0]...

Peter

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #15 from S Roderick <kiwi [dot] net [..] ...> 2008-06-02 20:28:32 ---
(In reply to comment #14)
> (In reply to comment #13)
> > Created an attachment (id=301)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=301) [details] [details]
> > Refined patch
> >
> > Cleaner patch. More capable use of boost program options (now returns variable
> > map to caller)
> >
> > Consolidates cdeployer and deployer-corba into cdeployer (removes need for
> > deployer-corba).
>
> I'm still thinking about this solution. It's one program less, but the default
> behavior of cdeployer changes from 'daemon' (no console) to console based.
> That breaks some scripts probably... On the other hand, I like the fact that
> only the server side needs an extra option such that 'console' usage causes
> less type work (a sane default).

Agreed. You decide. If it potentially breaks stuff, make it part of the v1.6
release?

> > Adds option to cdeployer to either run corba server (ie original behaviour), or
> > run taskbrowser with corba (ala deployer-corba).
> >
> > Adds option to turn off console logging
>
> This is not a 'perfect' implementation. I'd prefer to have a method that tells
> the logger to disable console logging, then to redirect it to a stringstream...
> We could check for 'stdoutput' not being null or an extra flag in
> maylogStdOut().

If you like, I can take a whack at this one ...?

> > NB the code to monkey with argc/argv is still not pretty ... :-(
> >
>
> I'm not sure that you can do it better... Does it matter for TAO what argv[0]
> contains ? I would just have passed to InitOrb(argc - taoIndex, argv[taoIndex]
> )...and drop taoArgc and taoArgv calculations. Just a guess.

The only thought is if TAO prints usage on an error, and includes the program
name. I didn't want to confuse the user in this case, by having an incorrect
"argv[0]".

S

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #14 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-31 00:41:08 ---
(In reply to comment #13)
> Created an attachment (id=301)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=301) [details]
> Refined patch
>
> Cleaner patch. More capable use of boost program options (now returns variable
> map to caller)
>
> Consolidates cdeployer and deployer-corba into cdeployer (removes need for
> deployer-corba).

I'm still thinking about this solution. It's one program less, but the default
behavior of cdeployer changes from 'daemon' (no console) to console based.
That breaks some scripts probably... On the other hand, I like the fact that
only the server side needs an extra option such that 'console' usage causes
less type work (a sane default).

>
> Adds option to cdeployer to either run corba server (ie original behaviour), or
> run taskbrowser with corba (ala deployer-corba).
>
> Adds option to turn off console logging

This is not a 'perfect' implementation. I'd prefer to have a method that tells
the logger to disable console logging, then to redirect it to a stringstream...
We could check for 'stdoutput' not being null or an extra flag in
maylogStdOut().

>
> NB the code to monkey with argc/argv is still not pretty ... :-(
>

I'm not sure that you can do it better... Does it matter for TAO what argv[0]
contains ? I would just have passed to InitOrb(argc - taoIndex, argv[taoIndex]
)...and drop taoArgc and taoArgv calculations. Just a guess.

Peter

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

S Roderick <kiwi [dot] net [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Attachment #300 is|0 |1
obsolete| |

--- Comment #13 from S Roderick <kiwi [dot] net [..] ...> 2008-05-23 16:45:37 ---
Created an attachment (id=301)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=301)
Refined patch

Cleaner patch. More capable use of boost program options (now returns variable
map to caller)

Consolidates cdeployer and deployer-corba into cdeployer (removes need for
deployer-corba).

Adds option to cdeployer to either run corba server (ie original behaviour), or
run taskbrowser with corba (ala deployer-corba).

Adds option to turn off console logging

NB the code to monkey with argc/argv is still not pretty ... :-(

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

S Roderick <kiwi [dot] net [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Attachment #278 is|0 |1
obsolete| |

--- Comment #12 from S Roderick <kiwi [dot] net [..] ...> 2008-05-23 02:06:24 ---
Created an attachment (id=300)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=300)
patch to deal with TAO options

Passes all unrecognized options through to TAO. If this isn't what you had in
mind, there are other approaches ...

Also removes an unnecessary InitOrb() call in deployer-corba.cpp

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #11 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-16 22:34:37 ---
$ svn ci -m"Apply patch by S. Roderick patch-538-deployercmdline.patch"
Sending bin/CMakeLists.txt
Sending bin/cdeployer.cpp
Sending bin/deployer-corba.cpp
Adding bin/deployer-funcs.cpp
Adding bin/deployer-funcs.hpp
Sending bin/deployer.cpp
Transmitting file data ......
Committed revision 29288.

I'm not sure if this patch already allows the TAO options ? Otherwise, we could
allow them after a '--' occurence or so and only pass the arguments before '--'
to the program options library.

[Bug 538] Unable specify log level when starting deployer

On May 16, 2008, at 16:34 , Peter Soetens wrote:

> For more infomation about this bug, visit > >
>
>
>
> --- Comment #11 from Peter Soetens

<peter [dot] soetens [..] ...> > 2008-05-16 22:34:37 ---
> $ svn ci -m"Apply patch by S. Roderick patch-538-
> deployercmdline.patch"
> Sending bin/CMakeLists.txt
> Sending bin/cdeployer.cpp
> Sending bin/deployer-corba.cpp
> Adding bin/deployer-funcs.cpp
> Adding bin/deployer-funcs.hpp
> Sending bin/deployer.cpp
> Transmitting file data ......
> Committed revision 29288.
>
> I'm not sure if this patch already allows the TAO options ?
> Otherwise, we could
> allow them after a '--' occurence or so and only pass the arguments
> before '--'
> to the program options library.

I just realised that it doesn't handle these correctly. Boost can
handle this situation, I'll send a further patch soon. It's only a
small change ...

Just one more patch ... ;-)

S

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

Peter Soetens

<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED

--- Comment #10 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-10 00:19:57 ---
Thanks. Applied on trunk/ocl.

$ svn ci config/ bin/ -m"Fixes bug #538: Unable specify log level when starting
deployer. Patch by S. Roderick.
deployer.cpp might be merged with other bin/*.cpp files lateron.
"
Sending bin/deployer.cpp
Sending config/check_depend.cmake
Transmitting file data ..
Committed revision 29270.

[Bug 538] Unable specify log level when starting deployer

We missed a file, and I screwed something(s) up. Patch below (with whitespace changes ignored - HTH).
Sorry

{{{
ocl $ svn diff -x -b bin/
Index: bin/deployer.cpp
===================================================================
--- bin/deployer.cpp (revision 29270)
+++ bin/deployer.cpp (working copy)
@@ -28,7 +28,7 @@
int ORO_main(int argc, char** argv)
{
std::string script;
- std::string name;
+ std::string name = \"Deployer\";
std::string logLevel = \"info\"; // set to valid default

po::options_description desc(\"Allowed options\");
@@ -37,13 +37,13 @@
(\"help\",
\"Show program usage\")
(\"start\",
- po::value(&script)->default_value(\"config-file.xml\"),
- \"Deployment configuration file\")
+ po::value(&script),
+ \"Deployment configuration file (eg 'config-file.xml')\")
(\"log-level\",
- po::value(&logLevel)->default_value(\"Info\"),
+ po::value(&logLevel),
\"Level at which to log (case-insensitive) Never,Fatal,Critical,Error,Warning,Info,Debug,Realtime\")
(\"DeployerName\",
- po::value(&name)->default_value(\"Deployer\"),
+ po::value(&name),
\"Name of deployer component\")
;
pos.add(\"DeployerName\", 1);
@@ -62,22 +62,27 @@
}
boost::algorithm::to_lower(logLevel); // always lower case
// verify that is a valid logging level
- if (vm.count(\"log-level\") &&
- (0 == logMap.count(logLevel)))
+ if (vm.count(\"log-level\"))
{
+ if (0 != logMap.count(logLevel))
+ {
+ RTT::Logger::Instance()->setLogLevel(logMap[logLevel]);
+ }
+ else
+ {
std::cout << \"Did not understand log level: \"
<< logLevel << std::endl
<< desc << std::endl;
return -1;
}
+ }
}
catch (std::logic_error e)
{
- std::cerr << \"Exception:\" << std::endl << e.what() << std::endl;
+ std::cerr << \"Exception:\" << e.what() << std::endl << desc << std::endl;
return -1;
}

- RTT::Logger::Instance()->setLogLevel(logMap[logLevel]);
OCL::DeploymentComponent dc( name );

if ( !script.empty() )
Index: bin/CMakeLists.txt
===================================================================
--- bin/CMakeLists.txt (revision 29270)
+++ bin/CMakeLists.txt (working copy)
@@ -4,7 +4,7 @@

ADD_EXECUTABLE( deployer-${OROCOS_TARGET} deployer.cpp )
PROGRAM_ADD_DEPS( deployer-${OROCOS_TARGET} orocos-taskbrowser orocos-deployment )
- TARGET_LINK_LIBRARIES( deployer-${OROCOS_TARGET} ${OROCOS_RTT_LIBS})
+ TARGET_LINK_LIBRARIES( deployer-${OROCOS_TARGET} ${OROCOS_RTT_LIBS} boost_program_options)
INSTALL_TARGETS( /bin deployer-${OROCOS_TARGET} )

ENDIF ( BUILD_TASKBROWSER AND BUILD_DEPLOYMENT)

}}}

[Bug 538] Unable specify log level when starting deployer

On Sunday 11 May 2008 19:03:32 snrkiwi wrote:
> We missed a file, and I screwed something up. Patch below (with whitespace
> changes ignored - HTH). Sorry

Thanks. I also won't test this patch :-). I'm really taking the open-source
mantra 'many testers find many bugs' in an uncommon interpretation...

Submitting patches through the orocos.org website is very tricky though. The
patch did not arrive correctly on the mailing list and copy/pasting it from
the website forum is a disaster as well. I'm not inclined to fix the website
now as we'll be 'soon' upgrading to Drupal 6, and maybe that release fixes
these problems by itself.

I got the patch by copy/pasting from the post's edit form. Admin access is a
tiny hurdle for those wanting to try out your patches for now...

Applied, thanks.

Peter

>
> {{{
> ocl $ svn diff -x -b bin/
> Index: bin/deployer.cpp
> ===================================================================
> --- bin/deployer.cpp (revision 29270)
> +++ bin/deployer.cpp (working copy)
> @@ -62,14 +62,20 @@
> }
> boost::algorithm::to_lower(logLevel); // always lower case
> // verify that is a valid logging level
> - if (vm.count("log-level") &&
> - (0 == logMap.count(logLevel)))
> + if (vm.count("log-level"))
> {
> + if (0 != logMap.count(logLevel))
> + {
> + RTT::Logger::Instance()->setLogLevel(logMap[logLevel]);
> + }
> + else
> + {
> std::cout

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #9 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-10 00:12:49 ---
(In reply to comment #8)
> Created an attachment (id=278)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=278) [details]
> Proposed patch
>
> Final proposed patch. The cmake mod's you proposed appear to work. The
> additional boost files I use are caught by the original cmake check for
> ublas.hpp file (at least in Ubuntu, they're all in the same package).

Yep. Same here.

Patch is fine, weren't it for the never ending coding style/indentation issues
I'm inflicting upon my peers. Also, the patch could apply on the other deployer
variants as well. We could merge them all in one deployer.cpp file later on.
I'll re-indent the patch and apply it.

Peter

[Bug 538] Unable specify log level when starting deployer

> Patch is fine, weren't it for the never ending coding style/
> indentation issues
> I'm inflicting upon my peers. Also, the patch could apply on the
> other deployer
> variants as well. We could merge them all in one deployer.cpp file
> later on.
> I'll re-indent the patch and apply it.

Merged the common command line parsing code and introduced it to the
other two deployers. I did _not_ integrate the 3 deployers, which
might have been what you had in mind?

Sorry in advance for the indenting ... I saw recent traffic re orocos-
emacs-c-mode. Was a consensus reached about the code?

HTH
S

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

[Bug 538] Unable specify log level when starting deployer

On Wednesday 14 May 2008 14:43:37 S Roderick wrote:
> > Patch is fine, weren't it for the never ending coding style/
> > indentation issues
> > I'm inflicting upon my peers. Also, the patch could apply on the
> > other deployer
> > variants as well. We could merge them all in one deployer.cpp file
> > later on.
> > I'll re-indent the patch and apply it.
>
> Merged the common command line parsing code and introduced it to the
> other two deployers. I did _not_ integrate the 3 deployers, which
> might have been what you had in mind?

Yes, but the patch is fine (well... did not apply it yet :-). Except that you
copy/pasted the ReportingComponent.hpp license header into
deployer-funcs.hpp. You should set your own copyright notice/email/date in
there, using the LGPL license.

>
> Sorry in advance for the indenting ... I saw recent traffic re orocos-
> emacs-c-mode. Was a consensus reached about the code?

Well, no tabs, 4 spaces indents.

Peter

[Bug 538] Unable specify log level when starting deployer

On May 14, 2008, at 09:12 , Peter Soetens wrote:

> On Wednesday 14 May 2008 14:43:37 S Roderick wrote:
>>> Patch is fine, weren't it for the never ending coding style/
>>> indentation issues
>>> I'm inflicting upon my peers. Also, the patch could apply on the
>>> other deployer
>>> variants as well. We could merge them all in one deployer.cpp file
>>> later on.
>>> I'll re-indent the patch and apply it.
>>
>> Merged the common command line parsing code and introduced it to the
>> other two deployers. I did _not_ integrate the 3 deployers, which
>> might have been what you had in mind?
>
> Yes, but the patch is fine (well... did not apply it yet :-). Except
> that you
> copy/pasted the ReportingComponent.hpp license header into
> deployer-funcs.hpp. You should set your own copyright notice/email/
> date in
> there, using the LGPL license.

Corrected.

Also trying Klaas's emacs orocos-mode (AKA Keep-Peter-Happy-With-Our-
Indenting ... :-) )

Patch attached.
S

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

S Roderick <kiwi [dot] net [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Attachment #274 is|0 |1
obsolete| |

--- Comment #8 from S Roderick <kiwi [dot] net [..] ...> 2008-05-08 21:30:07 ---
Created an attachment (id=278)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=278)
Proposed patch

Final proposed patch. The cmake mod's you proposed appear to work. The
additional boost files I use are caught by the original cmake check for
ublas.hpp file (at least in Ubuntu, they're all in the same package).
S

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #7 from S Roderick <kiwi [dot] net [..] ...> 2008-05-06 17:31:49 ---
(In reply to comment #6)
> Created an attachment (id=275)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=275) [details]
> Halts cmake if boost::program_options was not found

Understood. I've finished the code for this patch, and will take a look at the
cmake problem later today.
S

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #6 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-06 17:15:32 ---
Created an attachment (id=275)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=275)
Halts cmake if boost::program_options was not found

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #5 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-06 17:08:03 ---
(In reply to comment #3)
> Created an attachment (id=274)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=274) [details]
> Proposed patch using boost::program_options
>
> Patch for ocl/bin files
>

We'll have to modify the config/* cmake files as well to detect that the user
has installed the boost::program_options library and headers.
The cause of this report, adding --log=Info is not yet in this patch...

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #4 from S Roderick <kiwi [dot] net [..] ...> 2008-05-06 15:29:13 ---
(In reply to comment #3)
> Created an attachment (id=274)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=274) [details]
> Proposed patch using boost::program_options
>
> Patch for ocl/bin files
>

I just realised that I accidentally changed the config file option name. Line
23 of deployer.cpp should read

("start",

instead of

("config-file",

Sorry
S

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

--- Comment #3 from S Roderick <kiwi [dot] net [..] ...> 2008-05-06 14:34:38 ---
Created an attachment (id=274)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=274)
Proposed patch using boost::program_options

Patch for ocl/bin files

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

S Roderick <kiwi [dot] net [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
Status|NEW |ASSIGNED
Target Milestone|--- |1.6.0

--- Comment #2 from S Roderick <kiwi [dot] net [..] ...> 2008-05-06 13:53:26 ---
> > Would anyone be against using the boost::program_options library to do this?
> > Replacing the existing command line parsing would be trivial with this library
> > also.
>
> You're free to add this and it will be accepted, but it is in a way redundant.

I will go ahead and do this. We'd like to have a way, redundant though it is,
to specify the log level from command line and not have to manipulate the
environment.

[Bug 538] Unable specify log level when starting deployer

For more infomation about this bug, visit

Peter Soetens

<peter [dot] soetens [..] ...> changed:

What |Removed |Added
--------------------------------------------------------------------------
CC| |peter [dot] soetens [..] ...

--- Comment #1 from Peter Soetens

<peter [dot] soetens [..] ...> 2008-05-05 21:48:42 ---
(In reply to comment #0)
> Want to be able to specify the log level of the deployer application at startup
> e.g.
>
> deployer-gnulinux --log=DEBUG
>
> or
>
> deployer-gnulinux --log=Info

Just do:

export ORO_LOGLEVEL=6
or
export ORO_LOGLEVEL=5

deployer-gnulinux

>
> Would anyone be against using the boost::program_options library to do this?
> Replacing the existing command line parsing would be trivial with this library
> also.

You're free to add this and it will be accepted, but it is in a way redundant.

Peter