configureFileLogging method
配置原生文件日志缓冲策略,包括刷新间隔与缓冲上限。
Implementation
@override
/// 配置原生文件日志缓冲策略,包括刷新间隔与缓冲上限。
Future<void> configureFileLogging({
required bool enabled,
int? flushIntervalMs,
int? maxBufferEntries,
int? maxBufferBytes,
}) async {
try {
await methodChannel.invokeMethod<void>('configureFileLogging', {
'enabled': enabled,
if (flushIntervalMs != null) 'flushIntervalMs': flushIntervalMs,
if (maxBufferEntries != null) 'maxBufferEntries': maxBufferEntries,
if (maxBufferBytes != null) 'maxBufferBytes': maxBufferBytes,
});
} catch (_) {
// Ignore configuration failures.
}
}