Created
March 8, 2021 04:03
-
-
Save dsasse07/14cbba001863c8685f8d81a1a6703975 to your computer and use it in GitHub Desktop.
Log message generator class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Log { | |
static error(msg){ | |
let date = new Date(); | |
let time = date.toLocaleTimeString(); | |
return {type: 'error', msg: `[${time}] ERROR: ${msg}`} | |
} | |
static warn(msg){ | |
let date = new Date(); | |
let time = date.toLocaleTimeString(); | |
return {type: 'warn', msg: `[${time}] WARN: ${msg}`} | |
} | |
static notify(msg){ | |
let date = new Date(); | |
let time = date.toLocaleTimeString(); | |
return {type: 'notify', msg: `[${time}] NOTIFY: ${msg}`} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment