LoggerConfig class
日志系统配置类
Constructors
-
LoggerConfig({bool enabled = true, Set<
LogEventType> enabledEvents = const {LogEventType.buttonClick, LogEventType.pageNavigation, LogEventType.apiComplete}, PrivacyLevel privacyLevel = PrivacyLevel.normal, int maxFileSize = 50, int retentionDays = 7, int bufferSize = 100, Duration flushInterval = const Duration(seconds: 30), bool compressOldFiles = true, String? customStoragePath, UrlMaskConfig urlMaskConfig = const UrlMaskConfig.normal(), bool enableDebugMode = false, bool autoUpload = false, String? uploadEndpoint, LogFormat logFormat = LogFormat.pretty, bool enableNativeCrashDetection = true, int nativeMemoryWarningThreshold = 100, int anrDetectionTimeout = 8000}) -
const
- LoggerConfig.basic()
-
基础配置 - 适用于大多数场景
factory
- LoggerConfig.businessEnhanced()
-
业务增强配置
factory
- LoggerConfig.development()
-
开发环境配置
factory
- LoggerConfig.disabled()
-
禁用配置
factory
- LoggerConfig.production()
-
生产环境配置
factory
- LoggerConfig.smart()
-
智能配置 - 包含业务增强功能
factory
Properties
- anrDetectionTimeout → int
-
final
- autoUpload → bool
-
final
- bufferSize → int
-
final
- compressOldFiles → bool
-
final
- customStoragePath → String?
-
final
- enabled → bool
-
final
- enableDebugMode → bool
-
final
-
enabledEvents
→ Set<
LogEventType> -
final
- enableNativeCrashDetection → bool
-
原生崩溃检测配置
final
- flushInterval → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- logFormat → LogFormat
-
final
- maxFileSize → int
-
final
- nativeMemoryWarningThreshold → int
-
final
- privacyLevel → PrivacyLevel
-
final
- retentionDays → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uploadEndpoint → String?
-
final
- urlMaskConfig → UrlMaskConfig
-
final
Methods
-
copyWith(
{bool? enabled, Set< LogEventType> ? enabledEvents, PrivacyLevel? privacyLevel, int? maxFileSize, int? retentionDays, int? bufferSize, Duration? flushInterval, bool? compressOldFiles, String? customStoragePath, UrlMaskConfig? urlMaskConfig, bool? enableDebugMode, bool? autoUpload, String? uploadEndpoint}) → LoggerConfig - 复制并修改配置
-
getStoragePath(
) → Future< String> - 获取存储路径
-
getStoragePathByDate(
[DateTime? date]) → Future< String> - 获取按日期分文件夹的存储路径
-
isValid(
) → bool - 配置验证
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - 转换为JSON
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited