Skip to main content

Logger.log() method

log(level: LogLevel, message: string, options?: Partial<Omit<Log, "level" | "message" | "loggerLevel">>): void;

Parameters

ParameterTypeDescription
levelLogLevel
messagestring
optionsPartial<Omit<Log, "level" | "message" | "loggerLevel">>(Optional)
Returns:

void

Example 1

Basic message

logger.log(LogLevel.Info, "basic message");

Example 2

Error

logger.log(LogLevel.Error, "error log", {
error: new Error("error cause")
});

Example 3

Data

logger.log(LogLevel.Info, "log with data", {
data: {
foo: "bar"
}
});