mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 00:57:26 +03:00
log error when log level is not recognized
This commit is contained in:
parent
74ed915c4d
commit
7561fbfe89
@ -92,12 +92,18 @@ class RpcSession {
|
||||
static void _logEntry(String entry) {
|
||||
try {
|
||||
final record = jsonDecode(entry);
|
||||
Logger('helper.${record['name']}').log(
|
||||
_py2level[record['level']] ?? Level.INFO,
|
||||
record['message'],
|
||||
record['exc_text'],
|
||||
//time: DateTime.fromMillisecondsSinceEpoch(event['time'] * 1000),
|
||||
);
|
||||
var entryLevel = _py2level[record['level']];
|
||||
if (entryLevel == null) {
|
||||
Logger('helper.${record['name']}')
|
||||
.log(Levels.ERROR, 'Invalid log level: ${record['level']}');
|
||||
} else {
|
||||
Logger('helper.${record['name']}').log(
|
||||
entryLevel,
|
||||
record['message'],
|
||||
record['exc_text'],
|
||||
//time: DateTime.fromMillisecondsSinceEpoch(event['time'] * 1000),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
_log.error(e.toString(), entry);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user