Allow disabling of console output for logging. New macro CONSOLELOGGING set to true/false to enable/disable.
This commit is contained in:
@@ -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__)); }
|
||||
|
||||
|
Reference in New Issue
Block a user