-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: logger added, console logs replaced, additional logs added (fixes #15) #16
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks beautiful.
const m = d.getMonth() + 1 | ||
const date = `${d.getDate()}/${m < 10 ? `0${m}` : m}/${d.getFullYear().toString().slice(2)}` | ||
const time = `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}:${d.getMilliseconds()}` | ||
const str = `${date} - ${time}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use YYMMDD
order instead of DDMMYY
as American MMDDYY
vs European date format.
|
||
//Colour level for easy read, store log in this.logArr as string | ||
log(level, args) { | ||
const colour = this?.config?.levels[level]?.colour || 'grey' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need a way of doing --verbose
like flag which outputs debug level logs.
|
||
const outputName = `${type}_log` | ||
const outputFile = path.join(logPath, `${outputName}.json`) | ||
fs.writeJSONSync(outputFile, this.logArr, { replacer: null, spaces: 2 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logger should probably not write to disk as this might only be applicable for hand built courses. In the AAT you may find you want the result of this as an variable value only?
fixes #15
New: logger added, console logs replaced, additional logs added (fixes #15)