logger 0.0.3
Install from the command line:
Learn more about npm packages
$ npm install @nephelaiio/logger@0.0.3
Install via package.json:
"@nephelaiio/logger": "0.0.3"
About this version
Custom log utilities built on top of Winston for Node.js.
Install the package using npm:
npm install @nephelaiio/logger
First, initialize the logger by specifying the logging level and optionally some initial messages.
import { init } from "@nephelaiio/logger";
init(level, "info");
You can log messages at different levels using the utility methods.
import { debug, info, warn, error } from "@nephelaiio/logger";
debug("This is a debug message.");
info("This is an informational message.");
warn("This is a warning.");
error("This is an error.");
-
init(level: LogLevels, messages?: Messages, transports?: Transport[])
: Initialize logger. -
setInfo(msgs?: Messages)
: Set logging level to 'info'. -
setVerbose(msgs?: Messages)
: Set logging level to 'debug'. -
setWarn(msgs?: Messages)
: Set logging level to 'warn'. -
setQuiet(msgs?: Messages)
: Set logging level to 'error'. -
debug(message: string)
: Log a debug message. -
info(message: string)
: Log an informational message. -
warn(message: string)
: Log a warning message. -
error(message: string)
: Log an error message.
We welcome contributions! See CONTRIBUTING.md for details.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Please feel free to submit issues and enhancement requests here.