Logger.log() method
log(level: LogLevel, message: string, options?: Partial<Omit<Log, "level" | "message" | "loggerLevel">>): void;
Parameters
Parameter | Type | Description |
---|---|---|
level | LogLevel | |
message | string | |
options | Partial<Omit<Log, "level" | "message" | "loggerLevel">> | (Optional) |
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"
}
});