[Rock-dev] Updates to Logger

Jakob Schwendner jakob.schwendner at dfki.de
Wed Jan 21 12:03:18 CET 2015


> > There are two things left, that I did not want to change without
discussion:
> > (1) Currently CMake define NDEBUG, even on RelWithDebInfo. The base
> > level for the logger is currently determined by checking for NDEBUG,
> > and switching to LOG_LEVEL_WARN. This is not what I would expect.
> Not clear to me what you expected, but I in general I agree that we need a
> generally agreed on convention on the behaviour of the logger.
And where to use it. E.g. only for libraries, or also for the modules.
Currently there is a mix of using RTT logging, base/logging, and std::cout.

> >   My proposal is therefore
> > to change the base/cmake, to create a new symbol, e.g. -DRelease,
> > which is then used in the logger to set to WARN for Release packages,
> > and compile in everything otherwise.
> I don't think there is a need for additional symbols, since there are
already
> ways to set what can be compiled in, e.g. defining BASE_LOG_WARN will
> prevent all logs of less priority to be compiled in. I would prefer to
check at
> cmake level and set the BASE_LOG_XXX given on the behaviour we decide
> on.
> >   I could also set the BASE_LOG_LEVEL directly in the cmake, but that
> > makes it harder to override.
> No sure what you mean by that?
Excactly what you propose. Setting BASE_LOG_XXX in the cmake. However, there
should be a way to override it manually. 

Cheers,

Jakob



More information about the Rock-dev mailing list