1.0.0 • Published 12 months ago
@swiftpost/logger v1.0.0
@swiftpost/logger
A simple console logger with colors.
Installation
pnpm add @swiftpost/loggerUsage
import { Logger } from "@swiftpost/logger";
const logger = new Logger();Scoping
You can scope the logger to a specific module or feature.
const logger = new Logger({ scope: "auth" });Methods
info(message: string, ...args: any[])
Log an info message.
logger.info("This is an info message");output
warn(message: string, ...args: any[])
Log a warning message.
logger.warn("This is a warning message");output
error(message: string, ...args: any[])
Log an error message.
logger.error("This is an error message");output
debug(message: string, ...args: any[])
Log a debug message.
logger.debug("This is a debug message");output
1.0.0
12 months ago