This commit is contained in:
Adam Velebil 2022-05-11 08:32:10 +02:00
commit f52e47d249
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084

View File

@ -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);
}