首页的权限交接的弹窗(关闭了释放权限)+添加日志过滤功能,支持通过 shouldLog参数控制日志输出
This commit is contained in:
@@ -107,7 +107,13 @@ class SentryLoggerImpl implements ILoggerService {
|
||||
String message, {
|
||||
String level = 'INFO', // 'DEBUG', 'INFO', 'WARNING', 'ERROR'
|
||||
Map<String, dynamic>? data,
|
||||
bool shouldLog = false, // 默认 false 不打印,传 true 才打印
|
||||
}) {
|
||||
// 🔥 关键过滤:shouldLog 为 false 时直接返回,不打印
|
||||
if (!shouldLog) {
|
||||
return;
|
||||
}
|
||||
|
||||
final timestamp = DateTime.now().toIso8601String();
|
||||
final logEntry = "[$timestamp] [$level] $message ${data ?? ''}\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user