UNPKG

actionhero

Version:

The reusable, scalable, and quick node.js API server for stateless and stateful applications

16 lines (15 loc) 1.07 kB
import * as winston from "winston"; export declare let loggers: winston.Logger[]; export type ActionheroLogLevel = "emerg" | "alert" | "crit" | "error" | "warning" | "notice" | "info" | "debug"; /** * Log a message, with optional metadata. The message can be logged to a number of locations (stdio, files, etc) as configured via config/logger.js * * The most basic use. Will assume 'info' as the severity: `log('hello')` * Custom severity: `log('OH NO!', 'warning')` * Custom severity with a metadata object: `log('OH NO, something went wrong', 'warning', { error: new Error('things are busted') })` * * The default log levels are: `emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7`. * Logging levels in winston conform to the severity ordering specified by RFC5424: severity of all levels is assumed to be numerically ascending from most important to least important. * Learn more at https://github.com/winstonjs/winston */ export declare function log(message: string, severity?: ActionheroLogLevel, data?: any): void;