diff options
-rw-r--r-- | src/utils.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils.cc b/src/utils.cc index 8f296341..3e758449 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -520,6 +520,16 @@ namespace ledger { optional<std::string> _log_category; +struct __maybe_enable_debugging { + __maybe_enable_debugging() { + const char * p = std::getenv("LEDGER_DEBUG"); + if (p != NULL) { + _log_level = LOG_DEBUG; + _log_category = p; + } + } +} __maybe_enable_debugging_obj; + } // namespace ledger #endif // DEBUG_ON |