FileLoggerTree class

A tree that will write logs to a file. A new file will be created each day.

  • Directory: getApplicationDocumentsDirectory/logs

  • File pattern: _fileDateFormat.log

You can also provide the number of days to keep the files on the disk with the numberOfDays attribute

Constructors

FileLoggerTree({List<String> levels = FileLoggerLevels.ALL, int numberOfDays = 1, String logDateFormat = 'MM/dd/yyyy HH:mm:ss', String fileDateFormat = 'yyyy-MM-dd', String? locale})
Instantiate a new tree for Fimber that will write the logs to disk

Properties

directory Directory?
Returns the directory where the files are stored
no setter
fileDateFormat String
The format for each file (eg: yyyy-MM-dd => 2019-08-24.log)
final
hashCode int
The hash code for this object.
no setterinherited
levels List<String>
The levels for the LogTree
final
logDateFormat String
The format of the date before each log
final
numberOfDays int
The number of days to keep the log files onto the disk If you want to disable the auto-clean mechanism, just pass a null value
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getLevels() List<String>
Gets levels of logging serviced by this LogTree
log(String level, String msg, {String? tag, Object? ex, StackTrace? stacktrace}) → void
Logs message with log level and optional tag, ex (exception) stacktrace
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