Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis. Learn more
Socket
Log inDemoInstall

@byu-oit/logger

Package Overview
Dependencies
3
Maintainers
14
Versions
27
Issues
File Explorer

Advanced tools

@byu-oit/logger

Default configuration for pino logger

    0.3.14latest
    GitHub

Version published
Maintainers
14
Weekly downloads
222
decreased by-54.51%

Weekly downloads

Changelog

Source

v0.3.14

What’s Changed

  • Remove package-lock.json (#164) @GaryGSC

Readme

Source

BYU Logger

GitHub Release codecov

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).

Install

npm i @byu-oit/logger

Usage

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!'))
CommonJS Equivalent

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.

Options

Any pino options can be overridden, but for compliance with our logging standards, we recommend sticking to the defaults provided in this package.

Example of overwriting a default

import DefaultLogger from "./logger" const logger = DefaultLogger({ level: 'trace' })

FAQs

Last updated on 14 Dec 2021

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.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc