@byu-oit/logger
Advanced tools
Weekly downloads
Changelog
v0.3.14
Readme
Creates a pino
logger with default settings to match the CES Application Development logging standards.
It will pretty-print logs when run locally, but it will write logs in JSON when deployed (when NODE_ENV=production
).
npm i @byu-oit/logger
import DefaultLogger from '@byu-oit/logger'
const logger = DefaultLogger()
logger.info('Hello World')
logger.warn('Something weird happened')
logger.error(new Error('Something went wrong!'))
const { default: DefaultLogger } = require('@byu-oit/logger')
const logger = DefaultLogger()
logger.info('Hello World')
logger.warn('Something weird happened')
logger.error(new Error('Something went wrong!'))
The semantics are slightly different than functions like console.log()
and console.error()
.
Namely,
console.error('Something went wrong in X:', new Error('the error'))
would be roughly equivalent to
logger.error(new Error('the error'), 'Something went wrong in X')
For more details, see the pino
documentation here.
Any pino
options can be overridden, but for compliance with our logging standards, we recommend sticking to the defaults provided in this package.
import DefaultLogger from "./logger"
const logger = DefaultLogger({ level: 'trace' })
FAQs
Default configuration for pino logger
The npm package @byu-oit/logger receives a total of 215 weekly downloads. As such, @byu-oit/logger popularity was classified as not popular.
We found that @byu-oit/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.