Logger.log
Summary
The log method logs a message at the 'LOG' level to the console. It formats the message with a timestamp and optionally includes the function name or stack trace information.
Example Usage
javascript
import { Logger } from 'utility/Logger.js';
Logger.includeTrace = true; // optional for more information
Logger.log("This is a log message", { additional: "info" });Code Analysis
Inputs
message: The main message to log (string)....optionalParams: Additional parameters to log (any type).
Flow
- The method receives a
messageand any number ofoptionalParams. - It calls the
_formatMessagemethod with 'LOG' as the level and themessageto format the log entry. - The formatted message is then logged to the console using
console.log. - Any
optionalParamsare also passed toconsole.log.
Outputs
- Logs a formatted message to the console.