log method
Logs a message or event using the configured strategies.
Throws NotInitializedError if the logger has not been initialized.
message - The message to log.
event - Optional. The specific log event associated with the message.
context - Optional. Additional context data.
Implementation
Future<void> log(
dynamic message, {
LogEvent? event,
Map<String, Object>? context,
}) async {
if (!_isInitialized) {
throw NotInitializedError();
}
final entry = LogEntry.fromParams(
message: message,
level: LogLevel.info,
event: event,
context: context,
);
if (_logQueue == null) {
throw NotInitializedError();
}
_logQueue!.enqueue(entry);
}