Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.27
-
None
-
None
Description
The Logger.h file is unclear about what parts of argc and argv get processed. Specifically arg[0] in the list is ignored and generally unrecognized args are (usually) silently ignored. Consider the following calls:
const char* moArgs[]={"--log-enable", "debug+"}; Logger::configure(2, moArgs);
In this case the "--log-enable is ignored" and the "debug+" is ignored so nothing happens.
const char* moArgs[]={"", "--log-enable", "debug+"}; Logger::configure(3, moArgs);
This works to enable debug+ as expected.
const char* moArgs[]={"", "--log-enable", "debug+", "fubar"}; Logger::configure(4, moArgs);
This works to enable debug+ but ignores the weird switch.
None of these behaviors is really terrible but clearer descriptions of how they are intended to be used would be helpful. Consider changing Logger::configure from void to bool indicating that all the args were processed.