log method

Future<void> log(
  1. dynamic message, {
  2. LogEvent? event,
})

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.

Implementation

Future<void> log(dynamic message, {LogEvent? event}) async {
  if (!_isInitialized) {
    throw NotInitializedError();
  }
  for (var strategy in logger._strategies) {
    await strategy.log(message: message, event: event);
  }
}