Runtime logging switch
mlite opened this issue · comments
In the current design, we have to rebuild with release=1
to disable all logging, and the built binary does not log anything anymore. It's not convenient for trouble shooting problems in production. We need to be able to enable/disable logging by changing the bot.config's logging level without rebuilding the code.
For example:
D_NOTOP_PRINT("UDP pack sent (%d bytes)", numbytes);
Should be enabled/disabled by the logging level of bot.config.
Here is a simple example: https://gist.github.com/fclairamb/7441750
Another one: https://github.com/rxi/log.c
We need to replace most of the compile time enabled logging with runtime enabled logging.
Alright, this makes a lot of sense, I will start working on this.
This is done.