send logs about trace only in debug mode (#2115)

This commit is contained in:
cyan 2025-03-26 02:34:39 +01:00 committed by GitHub
parent 36600dd82b
commit 72e011ead0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 10 additions and 9 deletions

View file

@ -1,4 +1,5 @@
import 'dart:math';
import 'package:flutter/foundation.dart';
void printV(dynamic content) {
CustomTrace programInfo = CustomTrace(StackTrace.current);
@ -20,7 +21,7 @@ class CustomTrace {
try {
_parseTrace();
} catch (e) {
print("Unable to parse trace (printV): $e");
if (kDebugMode) print("Unable to parse trace (printV): $e");
}
}
@ -80,7 +81,7 @@ class CustomTrace {
columnStr = columnStr.replaceFirst(")", "");
this.columnNumber = int.tryParse(columnStr);
} catch (e) {
print("Unable to parse trace (printV): $e");
if (kDebugMode) print("Unable to parse trace (printV): $e");
}
}
}