#
ConsoleLogger
A basic console logger.
#
Reference
const logger = new ConsoleLogger(runtime, 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 { FireflyRuntime, ConsoleLogger, type LogLevel } from "@squide/firefly";
const logger = new ConsoleLogger(new FireflyRuntime());
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 { FireflyRuntime, ConsoleLogger, type LogLevel } from "@squide/firefly";
const logger = new ConsoleLogger(new FireflyRuntime(), LogLevel.error);
logger.error("Error log");
logger.critical("Critical log");