LoggerMessage class

Creates delegates for logging that can be cached and reused for improved performance.

These methods create delegates that avoid repeated allocations during logging operations by caching formatters and using closures.

Constructors

LoggerMessage()

Properties

hashCode int
The hash code for this object.
no setterinherited
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
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

define(LogLevel logLevel, EventId eventId, String formatString, {LogDefineOptions? options}) → void Function(Logger, Exception?)
Defines a log message with no parameters.
define1<T1>(LogLevel logLevel, EventId eventId, String formatString, {LogDefineOptions? options}) → void Function(Logger, T1, Exception?)
Defines a log message with one parameter.
define2<T1, T2>(LogLevel logLevel, EventId eventId, String formatString, {LogDefineOptions? options}) → void Function(Logger, T1, T2, Exception?)
Defines a log message with two parameters.
define3<T1, T2, T3>(LogLevel logLevel, EventId eventId, String formatString, {LogDefineOptions? options}) → void Function(Logger, T1, T2, T3, Exception?)
Defines a log message with three parameters.
define4<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, String formatString, {LogDefineOptions? options}) → void Function(Logger, T1, T2, T3, T4, Exception?)
Defines a log message with four parameters.
defineScope(String formatString) Disposable? Function(Logger)
Defines a log scope with no parameters.
defineScope1<T1>(String formatString) Disposable? Function(Logger, T1)
Defines a log scope with one parameter.
defineScope2<T1, T2>(String formatString) Disposable? Function(Logger, T1, T2)
Defines a log scope with two parameters.
defineScope3<T1, T2, T3>(String formatString) Disposable? Function(Logger, T1, T2, T3)
Defines a log scope with three parameters.