Prepare RuleGel 1.0

This commit is contained in:
2026-05-24 22:06:15 +03:00
parent 1adfc1fa0c
commit 16e86fb9d5
18 changed files with 413 additions and 6 deletions
+10
View File
@@ -3,7 +3,17 @@ import 'package:flutter/foundation.dart';
class AppLogger {
const AppLogger();
static final List<String> _lines = <String>[];
static List<String> get lines => List.unmodifiable(_lines);
static void clear() => _lines.clear();
void debug(String message, [Object? error, StackTrace? stackTrace]) {
final line = '[${DateTime.now().toIso8601String()}] $message'
'${error == null ? '' : ' error=$error'}';
_lines.add(line);
if (_lines.length > 200) _lines.removeRange(0, _lines.length - 200);
if (kDebugMode) {
debugPrint('[GelRule] $message');
if (error != null) debugPrint(' error: $error');