diff --git a/src/utils/classes.ts b/src/utils/classes.ts index 78e27ac..fb45b52 100755 --- a/src/utils/classes.ts +++ b/src/utils/classes.ts @@ -511,7 +511,7 @@ function addQuestion( logger.DebugLog('Adding new question to existing subject', 'qdb add', 1) data[i].Questions.push(question) } else { - logger.Log(`Creating new subject: ${subj}`) + logger.Log(`Creating new subject: "${subj}"`) data.push({ Name: subj, Questions: [question], diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 4ea3a5d..398005f 100755 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -80,13 +80,15 @@ function DebugLog(msg: string | object, name: string, lvl: number): void { } function Log(msg: string | object, color?: string): void { + if (loggingDisabled) return + let log = msg if (typeof msg !== 'object') { const delimiter = DELIM + C(color) log = getColoredDateString() + delimiter + C(color) + msg + C() } - if (!process.env.NS_NOLOG && !loggingDisabled) { + if (!process.env.NS_NOLOG) { console.log(log) } utils.AppendToFile(