ConsoleLogEvent class

A subclass of LogEvent specifically tailored for logging events to the console.

This class extends LogEvent by providing a customized toMap method that is particularly suited for console-based logging. It includes functionality for handling additional data such as messages in a way that's optimal for console output.

Example:

var consoleEvent = ConsoleLogEvent(
  eventName: 'user_login',
  eventMessage: 'User logged in successfully',
  parameters: {'userId': '12345'}
);
logger.log('A console-specific event', event: consoleEvent);
Inheritance

Constructors

ConsoleLogEvent({required String eventName, String? eventMessage, Map<String, Object>? parameters = const {}})
Constructs a ConsoleLogEvent with the necessary event attributes.

Properties

eventMessage String?
An optional message associated with the event, providing additional detail about the event's context or outcome.
finalinherited
eventName String
The name of the event. This is a required field and is used to identify the type of the event.
finalinherited
hashCode int
Generates a hash code based on the event name.
no setterinherited
parameters Map<String, Object>?
A map of key-value pairs containing additional parameters that provide more context to the event. This is useful for passing additional data that may be relevant to specific logs.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts the ConsoleLogEvent to a map, adapting the output specifically for console logging.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Checks the equality of LogEvent instances based on the event name.
inherited