mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
logging fix
This commit is contained in:
parent
e1747b9b11
commit
ab33a2e059
2 changed files with 4 additions and 2 deletions
|
@ -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],
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue