configureFileLogging method

  1. @override
Future<void> configureFileLogging({
  1. required bool enabled,
  2. int? flushIntervalMs,
  3. int? maxBufferEntries,
  4. int? maxBufferBytes,
})
override

配置原生文件日志缓冲策略,包括刷新间隔与缓冲上限。

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.
  }
}