mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
max log message length to store in db
This commit is contained in:
parent
09b51def04
commit
3d4d57a97c
1 changed files with 8 additions and 1 deletions
|
@ -49,9 +49,16 @@ class Logging {
|
|||
Logger.print(object, normalLength: !printFullLength);
|
||||
return;
|
||||
}
|
||||
String message = object.toString();
|
||||
|
||||
// random value to check max size of message before storing in db
|
||||
if (message.length > 20000) {
|
||||
message = "${message.substring(0, 20000)}...";
|
||||
}
|
||||
|
||||
final now = core.DateTime.now().toUtc();
|
||||
final log = Log()
|
||||
..message = object.toString()
|
||||
..message = message
|
||||
..logLevel = level
|
||||
..timestampInMillisUTC = now.millisecondsSinceEpoch;
|
||||
if (level == LogLevel.Error || level == LogLevel.Fatal) {
|
||||
|
|
Loading…
Reference in a new issue