AWSLogger class

A logging utility providing the ability to emit log entries, configure the level at which entries are emitted, and register plugins which can handle log entries as they're emitted.

Plugins are created by implementing AWSLoggerPlugin and calling AWSLogger.registerPlugin on an AWSLogger instance.

By default, a SimpleLogPrinter is registered on the root AWSLogger which impacts all child loggers.

Implemented types
Mixed in types
Implementers

Constructors

AWSLogger([String namespace = rootNamespace])
Creates a top-level AWSLogger.
factory
AWSLogger.detached([String namespace = 'Detached'])
Creates a detached AWSLogger which is not part of the global hierarchy.
AWSLogger.protected(String namespace)
A logging utility providing the ability to emit log entries, configure the level at which entries are emitted, and register plugins which can handle log entries as they're emitted.

Properties

hashCode int
The hash code for this object.
no setterinherited
logLevel LogLevel
The minimum LogLevel that will be emitted by the logger.
getter/setter pair
namespace String
The namespace of this logger.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
runtimeTypeName String
The string value of runtimeType, saving a runtime lookup and preventing obfuscation during web compilation.
no setteroverride

Methods

close() → void
Closes the resource and all connected objects.
override
createChild(String name) AWSLogger
Creates an AWSLogger with this as the parent.
debug(String message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with level LogLevel.debug.
error(String message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with level LogLevel.error.
getPlugin<Plugin extends AWSLoggerPlugin>() → Plugin?
Returns a plugin of type Plugin registered to this logger hierarchy or null.
info(String message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with level LogLevel.info.
log(LogLevel level, String message, [Object? error, StackTrace? stackTrace]) → void
Logs a message at the given level.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerPlugin<T extends AWSLoggerPlugin>(T plugin) → void
Registers an AWSLoggerPlugin to handle logs emitted by this logger instance.
toString() String
A string representation of this object.
inherited
unregisterAllPlugins() → void
Unregisters all AWSLoggerPlugins on this logger instance.
unregisterPlugin(AWSLoggerPlugin plugin) → void
Unregisters plugin from this logger instance.
verbose(String message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with level LogLevel.verbose.
warn(String message, [Object? error, StackTrace? stackTrace]) → void
Logs a message with level LogLevel.warn.

Operators

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

Static Properties

activeLoggers Map<String, AWSLogger>
The cache of all active loggers by namespace.
final

Constants

rootNamespace → const String
The root namespace for all AWSLogger instances.