Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

joe-allen-89
Copy link
Contributor

fixes #15

New: logger added, console logs replaced, additional logs added (fixes #15)

@joe-allen-89 joe-allen-89 added the enhancement New feature or request label May 16, 2024
@joe-allen-89 joe-allen-89 linked an issue May 16, 2024 that may be closed by this pull request
Copy link
Member

@oliverfoster oliverfoster left a 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}`
Copy link
Member

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'
Copy link
Member

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 });
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce logger and update log warnings.
2 participants