AsyncRotatingFileOutput constructor

AsyncRotatingFileOutput(
  1. String filePath, {
  2. int maxSizeBytes = 10 * 1024 * 1024,
  3. int maxBackups = 5,
})

Implementation

AsyncRotatingFileOutput(
  this.filePath, {
  this.maxSizeBytes = 10 * 1024 * 1024, // 10MB default
  this.maxBackups = 5,
})  : _file = File(filePath),
      _size = 0 {
  final dir = _file.parent;
  if (!dir.existsSync()) {
    dir.createSync(recursive: true);
  }
  _size = _file.existsSync() ? _file.lengthSync() : 0;
}