Logger
š”
This module is required and peer-dependent for @buny/core
package.
Introduction
Logger package offers a straightforward approach to logging messages to the console, ensuring simplicity and ease of use.
Installation
To install the package, run the following command:
npm install @buny/logger
Usage
To use @buny/logger
import Logger package and inject it into your module.
import {Usable, Use} from "@buny/di";
import Logger from "@buny/logger";
@Usable()
class MyClass {
@Use()
logger: Logger;
}
API
Logger#info
Logs an informational message to the console.
logger.info("Hello, world!");
Logger#warn
Logs a warning message to the console.
logger.warn("Hello, world!");
Logger#error
Logs an error message to the console.
logger.error(new Error("Hello, world!"));
Logger#debug
Logs a debug message to the console.
logger.debug("Hello, world!");
Logger#mark
Highlights a message in the console.
logger.info("Hello, ", logger.mark("world!"));