#
ConsoleLogger
A basic console logger.
#
Reference
const logger = new ConsoleLogger(logLevel?)
#
Parameters
logLevel
: An optional minimum level for the logger to output a log entry to the console (default isLogLevel.debug
).
#
Usage
#
Log everything
import { ConsoleLogger, type LogLevel } from "@squide/firefly";
const logger = new ConsoleLogger();
logger.debug("Debug log", { foo: "bar" });
logger.information("Info log");
logger.warning("Warning log");
logger.error("Error log");
logger.critical("Critical log");
#
Only log errors
To restrict the logs to error
or critical
, change the minimum log level to error
:
import { ConsoleLogger, type LogLevel } from "@squide/firefly";
const logger = new ConsoleLogger(LogLevel.error);
logger.error("Error log");
logger.critical("Critical log");