Allow the environment variable LEDGER_DEBUG to enable debugging.

This commit is contained in:
John Wiegley 2009-01-19 16:23:17 -04:00
parent 8a051119ac
commit 0ec53e4a6c

View file

@ -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