We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
logger.js
const moment = require('moment') const debug = require('debug') const log = debug('adonuxt-rp:log [ %s ]', moment().format()) const error = debug('adonuxt-rp:error [ %s ]', moment().format()) debug.log = console.info.bind(console) // https://www.npmjs.com/package/debug#output-streams const logger = { log, error } module.exports = logger module.exports.default = logger
I have that module imported throughout my app and is using it like so logger.log('Successfully created')
logger.log('Successfully created')
The output is not what I expect
adonuxt-rp:log [ +398ms ] Successfully created
Why is my date output defaulting to the millisecond output?
I'm expecting an output similiar to this:
adonuxt-rp:log [ 2017-05-14T04:08:26-05:00 ] Successfully created
The text was updated successfully, but these errors were encountered:
The API doesn't really work like that. The debug() function in your example only takes a single argument: the namespace.
debug()
Sorry, something went wrong.
What should I do in order to get the date to output?
Closing in favor of #582. Please move discussion there.
No branches or pull requests
logger.js
I have that module imported throughout my app and is using it like so
logger.log('Successfully created')
The output is not what I expect
Why is my date output defaulting to the millisecond output?
I'm expecting an output similiar to this:
The text was updated successfully, but these errors were encountered: