LogSettings class
日志配置类
用于配置 LogUtils 的全局行为。
示例:
LogUtils.init(settings: LogSettings(
useHistory: true,
maxHistoryItems: 200,
filters: [
LevelLogFilter(allowedLevels: {LogLevel.error, LogLevel.warning}),
PrefixLogFilter(prefixes: ['API', 'DB']),
],
));
Constructors
Properties
-
filters
→ List<
LogFilter> -
过滤器列表,日志必须通过所有过滤器才会被记录
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxHistoryItems → int
-
最大保存的日志历史条数
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useConsoleLogs → bool
-
是否输出到控制台
final
- useHistory → bool
-
是否保存日志历史
final
Methods
-
copyWith(
{List< LogFilter> ? filters, bool? useHistory, int? maxHistoryItems, bool? useConsoleLogs}) → LogSettings - 创建配置的副本,可覆盖部分字段
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited