Force log level at exec time
As a | CEP developer |
I would like to | change the log level and parameters at run time |
So that | I don't have to re-compile my executable eveytime I need to check something or diagnose a problem |
Epic/Topics | Log system |
Description / Overview
Choose one of (or both) solution:
- enable the possibility to force the log parameter using environment variable, e.g.::ab:
CAMITK_LOG_LEVEL=WARNING CAMITK_LOG_TO_STDOUT=FALSE CAMITK_LOG_TO_FILE=TRUE CAMITK_LOG_FILE_DIRECTORY=/tmp camitk-imp"
to force camitk-imp
running with these log parameters instead of those defined in source or settings
Caveat: you need to modify the environment variable and access to it from the code. Not really a problem, but can be tricky for people who don't understand it properly, modify their global environment (e.g. in ~/.bashrc) and then forgot they had define these things.
- manage a
--debug=[options]
argument from the command line execution for all CamiTK application with different options:
log level:
le (error)
lw (warning)
li (info)
lt (trace)
d (display debug)
s (display time stamp)
log message:
me
mw
mi
mt
p
Hints
- Use Qt to read the environment variables and modify the application properties accordingly
- Add a flag to
camitk-imp
andcamitk-config
arguments
Acceptance tests
-
there are more tests of the testlogger class that shows it work -
the Log System
document is updated accordingly