mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-24 09:26:49 +00:00

* chore: run flutter create on flowy_sdk * chore: rename flowy-sdk to flowy-core * chore: rename flowy_sdk to appflowy_backend * chore: fix windows build * chore: replace bloctest with test Co-authored-by: nathan <nathan@appflowy.io> Co-authored-by: vedon <vedon.fu@gmail.com>
41 lines
987 B
Dart
41 lines
987 B
Dart
// ignore: import_of_legacy_library_into_null_safe
|
|
import 'package:logger/logger.dart';
|
|
|
|
class Log {
|
|
static final shared = Log();
|
|
late Logger _logger;
|
|
|
|
Log() {
|
|
_logger = Logger(
|
|
printer: PrettyPrinter(
|
|
methodCount: 2, // number of method calls to be displayed
|
|
errorMethodCount: 8, // number of method calls if stacktrace is provided
|
|
lineLength: 120, // width of the output
|
|
colors: true, // Colorful log messages
|
|
printEmojis: true, // Print an emoji for each log message
|
|
printTime: false // Should each log print contain a timestamp
|
|
),
|
|
);
|
|
}
|
|
|
|
static void info(dynamic msg) {
|
|
Log.shared._logger.i(msg);
|
|
}
|
|
|
|
static void debug(dynamic msg) {
|
|
Log.shared._logger.d(msg);
|
|
}
|
|
|
|
static void warn(dynamic msg) {
|
|
Log.shared._logger.w(msg);
|
|
}
|
|
|
|
static void trace(dynamic msg) {
|
|
Log.shared._logger.v(msg);
|
|
}
|
|
|
|
static void error(dynamic msg) {
|
|
Log.shared._logger.e(msg);
|
|
}
|
|
}
|