From b87e0cf0b4f3bd1c1d642f93a08341c0b89def8a Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 11 Aug 2019 17:33:03 -0400 Subject: [PATCH] Docs about logging options; default logging setting; Fixes #128 --- .env-sample | 5 +++++ app.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env-sample b/.env-sample index 3c76162..6538c6e 100644 --- a/.env-sample +++ b/.env-sample @@ -1,3 +1,8 @@ +# Optional logging settings, see comments after each for more info +#DEBUG=* # Enable all logging, including middleware, etc +#DEBUG=btcexp:* # Enable all logging specific to btc-rpc-explorer +#DEBUG=btcexp:app,btcexp:error # Default logging setting if "DEBUG" is not set + # The active coin: BTC/LTC #BTCEXP_COIN=BTC diff --git a/app.js b/app.js index 13db2ab..514198e 100755 --- a/app.js +++ b/app.js @@ -16,7 +16,7 @@ configPaths.filter(fs.existsSync).forEach(path => { // debug module is already loaded by the time we do dotenv.config // so refresh the status of DEBUG env var var debug = require("debug"); -debug.enable(process.env.DEBUG); +debug.enable(process.env.DEBUG || "btcexp:app,btcexp:error"); var debugLog = debug("btcexp:app"); var debugPerfLog = debug("btcexp:actionPerformace");