From cd52e15ce56b704552bb5a1f5ec4992e08e9b82f Mon Sep 17 00:00:00 2001 From: faulty Date: Sat, 7 May 2022 17:01:19 +0200 Subject: [PATCH] small changes --- lib/logging.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/logging.js b/lib/logging.js index eddb9f0..f35cdca 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -12,8 +12,8 @@ class Logger { * onHistoryFull: () => void, * argsPlaceholder: string, * dict: {[key: string]: string} - * logFrom: string - * logFrom2: string + * logFrom: 'debug' | 'info' | 'warn' | 'error' | 'fatal' + * logFrom2: 'debug' | 'info' | 'warn' | 'error' | 'fatal' * }} options */ constructor(options = {}) @@ -38,8 +38,8 @@ class Logger { this.alog("warn;", "History is full, dropping 25 oldest entries."); this.history = this.history.slice(25); }; - this.logFrom = options.logFrom || "D"; // when to stop logging to output - this.logFrom2 = options.logFrom2 || "D"; // when to stop logging to output2 + this.logFrom = options.logFrom ? options.logFrom.charAt(0).toUpperCase() : "D"; // when to stop logging to output + this.logFrom2 = options.logFrom2 ? options.logFrom2.charAt(0).toUpperCase() : "D"; // when to stop logging to output2 // Order from least important to most: D, I, W, E, F this.logImportance = { D: 0, I: 1, W: 2, E: 3, F: 4