From 87e99aa4a7274077bbcf0996cf31845ed75fce82 Mon Sep 17 00:00:00 2001 From: RohovAlex <47148269+RohovAlex@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:35:00 +0300 Subject: [PATCH] added default params toFile, toStdout in constructor --- metalog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metalog.js b/metalog.js index 7cfd40b..c9473fe 100644 --- a/metalog.js +++ b/metalog.js @@ -47,7 +47,7 @@ const DEFAULT_FLAGS = { error: false, }; -const logTypes = (types = LOG_TYPES) => { +const logTypes = (types) => { const flags = { ...DEFAULT_FLAGS }; for (const type of types) { flags[type] = true; @@ -188,7 +188,7 @@ class Logger extends events.EventEmitter { super(); const { workerId = 0, createStream = fs.createWriteStream } = args; const { writeInterval, writeBuffer, keepDays, home, json } = args; - const { toFile = [], toStdout = [] } = args; + const { toFile = LOG_TYPES, toStdout = LOG_TYPES } = args; this.active = false; this.path = args.path; this.workerId = `W${workerId}`;