From a190af079d1b5e5fce7855e865f540e5e0419707 Mon Sep 17 00:00:00 2001 From: Alexander <7adietri@users.noreply.github.com> Date: Sat, 21 Mar 2020 14:43:25 +0100 Subject: [PATCH] Add shutdown() to non-disk logger The script `evict-inactive.js` calls `Log.shutdown()` at the end, which currently fails if logging to disk has been disabled via `logPath`. --- lib/log.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/log.js b/lib/log.js index 756da8734..695f15b04 100644 --- a/lib/log.js +++ b/lib/log.js @@ -96,7 +96,9 @@ Logger.create = function (config, cb) { if (!config.logPath) { console.log("No logPath configured. Logging to file disabled"); - return void cb(Object.freeze(createMethods(ctx))); + var logger = createMethods(ctx); + logger.shutdown = noop; + return void cb(Object.freeze(logger)); } Store.create({