24 lines
524 B
Dart
24 lines
524 B
Dart
import 'package:logger/logger.dart';
|
||
|
||
final _logger = Logger(
|
||
printer: PrettyPrinter(
|
||
// 要显示的方法调用的数量
|
||
methodCount: 0,
|
||
// 如果提供了stacktrace,则方法调用的数量
|
||
errorMethodCount: 8,
|
||
// 输出的宽度
|
||
lineLength: 120,
|
||
// 丰富多彩的日志消息
|
||
colors: true,
|
||
// 是否打印表情符号
|
||
printEmojis: true,
|
||
),
|
||
);
|
||
|
||
class Log {
|
||
static const String _tag = 'Log';
|
||
|
||
Log.d(dynamic msg, {String tag = _tag}) {
|
||
_logger.d('[$tag]: $msg');
|
||
}
|
||
} |