SizeRollingFileTree class

SizeRolling file tree. It will create new log file with an index every time current one reach maxDataSize

Inheritance

Constructors

SizeRollingFileTree(DataSize maxDataSize, {String logFormat = CustomFormatTree.defaultFormat, String filenamePrefix = 'log_', String filenamePostfix = '.txt', List<String> logLevels = CustomFormatTree.defaultLevels})
Creates instance of SizeRollingFileTree, which based on defined maxDataSize size of current log file will create new log file.

Properties

colorizeMap Map<String, ColorizeStyle>
Map of log levels and their colorizing style.
getter/setter pairinherited
filenamePostfix String
Filename postfix, by default ".txt".
getter/setter pair
filenamePrefix String
Filename prefix - can contain path to directory where logs would be saved. by default "log_"
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
logFormat String
Log line format style.
getter/setter pairinherited
maxDataSize DataSize
Maximum size allowed for the log file before rolls to new.
getter/setter pair
outputFileName String
Output current log file name.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes a tree, use it to flush buffer/caches or close any resource.
inherited
detectFileIndex() → void
Detects file index based on same filenamePrefix and filenamePostfix and based on current files in the log directory.
getLevels() List<String>
Gets levels of logging serviced by this LogTree
inherited
getLogIndex(String filePath) int
Gets log index from a file path.
isLogFile(String filePath) bool
Checks if this is matching log file.
log(String level, String msg, {String? tag, dynamic ex, StackTrace? stacktrace}) → void
Logs a message with level/tag and optional stacktrace or exception.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printLine(String line, {String? level}) Future<void>
Prints log line with optional log level.
inherited
printLog(String logLine, {String? level}) → void
Method to overload printing to output stream the formatted logline Adds handing of time
inherited
rollToNextFile() → void
Roll to new file
override
shouldRollNextFile() FutureOr<bool>
Return true if log file should rotate to new.
override
toString() String
A string representation of this object.
inherited

Operators

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