Allow disabling of console output for logging. New macro CONSOLELOGGING set to true/false to enable/disable.

This commit is contained in:
2024-07-18 10:48:27 -04:00
parent 47e06dd8ed
commit aace84af52
3 changed files with 9 additions and 17 deletions

View File

@@ -21,6 +21,7 @@
namespace jlog
{
/// Severity levels for logging. Higher numbers filter less messages out.
/// @see LOG_LEVEL macro
enum class severity : uint8_t
@@ -34,6 +35,7 @@ namespace jlog
};
inline severity loglevel = severity::debug; // Default log level always debug
inline bool console_logging = true;
struct LogEntry
{
@@ -235,5 +237,7 @@ namespace jlog
#define LOGLEVEL(i) jlog::loglevel = i;
#define CONSOLELOGGING(i) jlog::console_logging = i
#define LOGTEST(i) if (jlog::loglevel >= jlog::severity::none) { jlog::ltlog(jlog::info_detailed_format(i, FUNCTION, __FILE__, __LINE__)); }