Skip to content

Commit

Permalink
added default params toFile, toStdout in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
RohovAlex committed Oct 12, 2023
1 parent 51731d7 commit 87e99aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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}`;
Expand Down

0 comments on commit 87e99aa

Please sign in to comment.