You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that this library should me more Dart like in place of Android like. So for me there will be better to use Dart Levels (package:logging/logging.dart) in place of android levels.
I made some mapping from Android to dart logging levels:
library Levels
Native Levels
nothing
ALL
---
FINEST
---
FINER
verbose
FINE
debug
CONFIG
info
INFO
warning
WARNING
error
SEVERE
wtf
SHOUT
And I implemented it in custom LogOutput:
import'dart:developer';
import'package:logger/logger.dart';
import'package:logging/logging.dart'as dartLog;
classPrettierConsoleOutputextendsLogOutput {
final _lvlMapping = {
Level.nothing: dartLog.Level.ALL.value,
Level.verbose: dartLog.Level.FINE.value,
Level.debug: dartLog.Level.CONFIG.value,
Level.info: dartLog.Level.INFO.value,
Level.warning: dartLog.Level.WARNING.value,
Level.error: dartLog.Level.SEVERE.value,
Level.wtf: dartLog.Level.SHOUT.value,
};
@overridevoidoutput(OutputEvent event) {
for (var line in event.lines) {
log(line, level: _lvlMapping[event.level]);
}
}
}
I like that the IDEs (Android Studio too) has support for this. Especially since colouring of console output in the IDEs doesn't work. This goes on my todo list.
I think that this library should me more Dart like in place of Android like. So for me there will be better to use Dart Levels (
package:logging/logging.dart
) in place of android levels.I made some mapping from Android to dart logging levels:
And I implemented it in custom
LogOutput
:It gives us much better log filtering and you can easly add colors to them:
flutter/flutter-intellij#2200 (comment)
The text was updated successfully, but these errors were encountered: