Logger: Do not show null elements

Extremely hacky, I know.
This commit is contained in:
Vishesh Handa
2021-02-15 12:28:35 +01:00
parent cfbd669109
commit dab2b07a88

View File

@ -211,8 +211,16 @@ class LogMessage {
t = map['t'];
l = map['l'];
msg = map['msg'];
ex = map['ex'];
stack = map['stack'];
props = map['p'];
ex = _checkForNull(map['ex']);
stack = _checkForNull(map['stack']);
props = _checkForNull(map['p']);
}
}
dynamic _checkForNull(dynamic e) {
if (e == null) return e;
if (e.runtimeType == String && e.toString().trim() == 'null') {
return null;
}
return e;
}