Allow the environment variable LEDGER_DEBUG to enable debugging.
This commit is contained in:
parent
8a051119ac
commit
0ec53e4a6c
1 changed files with 10 additions and 0 deletions
10
src/utils.cc
10
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue