In Flutter/Dart, is it possible to easily ignore log messages based on a particular tag name? For example, here’s my main()
:
void main() async {
// logging setup.
Logger.root.level = kDebugMode ? Level.FINE : Level.INFO;
Logger.root.onRecord.listen((record) {
dev.log(
record.message,
time: record.time,
level: record.level.value,
name: record.loggerName,
);
});
...
runApp(MyApp());
}
I would like to temporarily ignore all logs from a particular class, like this one without having to do something silly, like comment all _log.info(...
lines, or wrapping each one in a conditional to switch them on/off based on a flag:
class AudioController {
static final _log = Logger('AudioController');
...