Logger class

Logger 日志工具类

说明

提供统一日志输出接口,支持开发调试环境日志打印,避免 release 环境输出敏感日志。

快速示例

Logger.log('普通日志');
Logger.trace('带调用堆栈信息的日志');

Constructors

Logger()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Methods

log(String message) → void
普通日志输出,仅在debug/dev模式下生效,release版自动忽略。
trace(String message) → void
高级跟踪日志,输出日志同时包含调用位置(文件名、行号和方法名)。 仅在debug/dev模式下生效,release版自动忽略。