handleRecord method
Handle the BDLogRecord.
Implementation
@override
Future<void> handleRecord(BDLogRecord record) async {
writer ??= initializeFileSink(logFileDirectory);
assert(writer != null, 'sink should not be null here');
final double currentFileSizeInMB =
currentLogFile.lengthSync() / (1024 * 1024);
if (currentFileSizeInMB >= maxLogSizeInMb) {
onFileExceededMaxSize();
removeOldLogFilesIfRequired();
}
writer?.writeStringSync(logFormatter.format(record));
}