11import 'dart:async' ;
22import 'dart:core' ;
3- import 'dart:io' ;
3+ import 'dart:io' ; // todo deprecate
44
55import 'package:fimber/colorize.dart' ;
66import 'package:fimber/filename_format.dart' ;
@@ -10,6 +10,7 @@ import 'package:fimber/fimber.dart';
1010/// This tree if planted will post short formatted (elapsed time and message)
1111/// output into file specified in constructor.
1212/// Note: Mostly for testing right now
13+ @Deprecated ("Use `fimber_io` package to get benefits of dart:io with Fimber." )
1314class FimberFileTree extends CustomFormatTree with CloseableTree {
1415 /// Output current log file name.
1516 String outputFileName;
@@ -39,14 +40,14 @@ class FimberFileTree extends CustomFormatTree with CloseableTree {
3940 _maxBufferSize = maxBufferSize;
4041 _bufferWriteInterval =
4142 Stream .periodic (Duration (milliseconds: bufferWriteInterval), (i) {
42- // group calls
43- var dumpBuffer = _logBuffer;
44- _logBuffer = [];
45- _bufferSize = 0 ;
46- return dumpBuffer;
47- }).listen ((newLines) async {
48- _flushBuffer (newLines);
49- });
43+ // group calls
44+ var dumpBuffer = _logBuffer;
45+ _logBuffer = [];
46+ _bufferSize = 0 ;
47+ return dumpBuffer;
48+ }).listen ((newLines) async {
49+ _flushBuffer (newLines);
50+ });
5051 }
5152
5253 void _checkSizeForFlush () {
@@ -113,6 +114,7 @@ class FimberFileTree extends CustomFormatTree with CloseableTree {
113114/// SizeRolling file tree.
114115/// It will create new log file with an index every time current
115116/// one reach [maxDataSize]
117+ @Deprecated ("Use `fimber_io` package to get benefits of dart:io with Fimber." )
116118class SizeRollingFileTree extends RollingFileTree {
117119 /// Maximum size allowed for the log file before rolls to new.
118120 DataSize maxDataSize;
@@ -131,9 +133,9 @@ class SizeRollingFileTree extends RollingFileTree {
131133 /// will create new log file.
132134 SizeRollingFileTree (this .maxDataSize,
133135 {logFormat = CustomFormatTree .defaultFormat,
134- this .filenamePrefix = "log_" ,
135- this .filenamePostfix = ".txt" ,
136- logLevels = CustomFormatTree .defaultLevels})
136+ this .filenamePrefix = "log_" ,
137+ this .filenamePostfix = ".txt" ,
138+ logLevels = CustomFormatTree .defaultLevels})
137139 : super (logFormat: logFormat, logLevels: logLevels) {
138140 detectFileIndex ();
139141 }
@@ -236,6 +238,7 @@ class SizeRollingFileTree extends RollingFileTree {
236238
237239/// Time base rolling file tree.
238240/// It will use time span to roll logging to next file.
241+ @Deprecated ("Use `fimber_io` package to get benefits of dart:io with Fimber." )
239242class TimedRollingFileTree extends RollingFileTree {
240243 /// Number of seconds in an hour
241244 static const int hourlyTime = 60 * 60 ;
0 commit comments