Logging class
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
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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 particularlogLevel
ifisLoggable(logLevel)
is true. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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