cee-studio / orca

C Multi-REST API library for Discord, Slack, Reddit, etc.

Home Page:https://cee-studio.github.io/orca/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runtime logging switch

mlite opened this issue · comments

commented

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.

commented

For example:

D_NOTOP_PRINT("UDP pack sent (%d bytes)", numbytes);

Should be enabled/disabled by the logging level of bot.config.

commented

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.