Logging class Null safety

This is a wrapper around Logger which allows you to create child loggers by calling () on the instance. This is useful for creating loggers with different namespaces.

Example:

Logger logger = Logger('my.namespace');

final logging = Logging(logger);
logging.info('Hello'); // will print to console with namespace 'my.namespace'.

final sampleLogger = logging('Sample');
sampleLogger.info('Hello'); // will print to console with namespace 'my.namespace.Sample'.

Constructors

Logging(String name)
Create a new Logging instance with a name.
Logging.fromLogger(Logger logger)
Create a new Logging instance with a Logger.

Properties

hashCode int
The hash code for this object.
read-onlyinherited
logger Logger
All logging methods on this class are delegated to this Logger.
final
name String
final
onRecord Stream<LogRecord>
Returns a stream of messages added to this logger.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

call(String name) Logging
Create a new child Logging instance with a name.
config(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.CONFIG.
fine(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.FINE.
finer(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.FINER.
finest(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.FINEST.
info(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.INFO.
log(Level logLevel, Object? message, dynamic error, StackTrace? stackTrace) → void
Adds a log record for a message at a particular logLevel if isLoggable(logLevel) is true.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
severe(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.SEVERE.
shout(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.SHOUT.
toString() String
A string representation of this object.
inherited
warning(Object? message, [Object? error, StackTrace? stackTrace]) → void
Log message at level Level.WARNING.

Operators

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