rice-eclipse / resfet

Hybrid rocket engine control software for engine tests (coldflow and hotfire), written in C++.
http://eclipse.rice.edu/resfet
GNU General Public License v3.0
1 stars 1 forks source link

Logger Module (for Runtime Messages) #2

Closed andrewobler closed 5 years ago

andrewobler commented 5 years ago

We should have a dedicated logging module to replace generic printf() or std::cout statements and make console feedback cleaner. Doesn't have to be anything too complex, but should have multiple levels like info, error, and debug (ideally that can be switched through macros), and should have support for context-specific tags. Something like:

Logger logger("Example");
logger.debug("Here is a debug message!\n");
logger.info("Here is an info message!\n");

Output:

[DEBUG] Example: Here is a debug message!
[INFO] Example: Here is an info message!
berkalpyakici commented 5 years ago

I am quite positive there might be some packages that does this like 'logger'. The settings can be LOG_DISPLAY=<debug>,<info>,<none>.

<debug> will show all messages on console. <info> will show warnings and infos. <none> will not show anything on console - this can benefit us a lot by not spending any processing power on display.

Nonetheless, we want a /logs directory that will be populated by log files (logs everything regardless the setting above), named by the creation dates (a log file for each ./run command - instance). We should use ISO 8601 format (2013-04-01T13:01:02).