@typeix/logger
TypeScript icon, indicating that this package has built-in type declarations

8.7.0 • Public • Published

Typeix Logo

A progressive Node.js tools for building efficient and scalable applications.

@typeix/logger

Build Status Coverage Status npm

Logger

Resty comes with a built-in Pino logger wrapper which is used during application bootstrapping such as displaying scanned routing info (i.e., system logging, bootstrap errors).

You can fully control the behavior of the logging system:

  • disable logging entirely
  • specify the log level of detail (e.g., display errors, warnings, debug information, etc.)
  • customize the default logger by extending it
  • create your own custom implementation, to log your own application-level events and messages.

For more advanced logging functionality, you can make use of any Node.js logging package, such as Winston, to implement a completely custom, production grade logging system.

Usage

interface LoggerOptions {
  options: pino.LoggerOptions;
  stream?: pino.DestinationStream;
}
const options: LoggerOptions = {
    options: {
        level: "error"
    }
};
const logger = new Logger(options);
logger.info({id: 1, whatever: 2}, "Some nice custom message");

/@typeix/logger/

    Package Sidebar

    Install

    npm i @typeix/logger

    Homepage

    typeix.com

    Weekly Downloads

    19

    Version

    8.7.0

    License

    MIT

    Unpacked Size

    14.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • igorzg