Commit 461490d0f31d18bc7737f392fabdb1503085337a
Handle non-existent conf.logging
Julia Friesel committed on 4/14/2018, 10:12:06 AMParent: 5d199dd6f09c4e76f752a63c134177543d101688
Files changed
plugins/logging.js | changed |
plugins/logging.js | ||
---|---|---|
@@ -51,10 +51,13 @@ | ||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | 54 | module.exports = function logging (server, conf) { |
55 | - var level = conf.logging && conf.logging.level ? conf.logging.level : DEFAULT_LEVEL | |
56 | - level = LOG_LEVELS.indexOf(level) | |
55 | + if (conf.logging && conf.logging.level) { | |
56 | + level = LOG_LEVELS.indexOf(conf.logging.level) | |
57 | + } else { | |
58 | + level = DEFAULT_LEVEL | |
59 | + } | |
57 | 60 | |
58 | 61 | if (level === -1) { |
59 | 62 | console.log('Warning, logging.level configured to an invalid value:', conf.logging.level) |
60 | 63 | console.log('Should be one of:', LOG_LEVELS.join(', ')) |
Built with git-ssb-web