Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nooks-ai/nooks-logger

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nooks-ai/nooks-logger

Logger for Node.js

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
increased by20.44%
Maintainers
0
Weekly downloads
 
Created
Source

Classes

Logger

Logger

new Logger(serviceName, options)

Creates a JSON Logger for Node Applications

ParamTypeDescription
serviceNameStringName of the service or application.
optionsObjectConfiguration options.
options.levelStringMinimum level logged. Static fields are provided for convenience: Logger.DEBUG, Logger.INFO, Logger.WARN, Logger.ERROR, and Logger.FATAL. Defaults to Logger.INFO.
options.metadataObjectInitial fields to include with every log from logger instance

logger.debug(message, data)

Writes a debug JSON log to the console.

ParamTypeDescription
messagestringlog message.
metadataObjectextra metadata associated with the log.

logger.info(message, data)

Writes an info JSON log to the console.

ParamTypeDescription
messagestringlog message.
metadataObjectextra metadata associated with the log.

logger.warn(message, data)

Writes a warning JSON log to the console.

ParamTypeDescription
messagestringlog message.
metadataObjectextra metadata associated with the log.

logger.error(message, data)

Writes an error JSON log to the console.

ParamTypeDescription
messagestringlog message.
metadataObjectextra metadata associated with the log.

logger.fatal(message, data)

Writes a fatal JSON log to the console.

ParamTypeDescription
messagestringlog message.
metadataObjectextra metadata associated with the log.

logger.trace(message, data)

Writes a trace JSON log to the console.

ParamTypeDescription
messagestringlog message.
metadataObjectextra metadata associated with the log.

logger.err(error) ⇒ Logger

Creates a new logger with the error field set at root to be serialized nicely.

Returns: Logger - returns child logger to log a unit of work.

ParamTypeDescription
errorErrora javascript Error.

logger.data(data) ⇒ Logger

Chainable command to define extra metadata to be included in all subsequent logs.

Returns: Logger - returns child logger that will include extra metadata in all subsequent logs.

ParamTypeDescription
dataObjecttop-level data to add to logs.

FAQs

Package last updated on 02 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc