feat(core): add AppLogger
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6b150945fa
commit
2a3f489a2d
18
lib/core/logger.dart
Normal file
18
lib/core/logger.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
/// Logger minimal de l'application. Remplace les appels directs à print().
|
||||
/// Silencieux en release.
|
||||
class AppLogger {
|
||||
AppLogger._();
|
||||
|
||||
static void info(String message) {
|
||||
if (kDebugMode) debugPrint('[INFO] $message');
|
||||
}
|
||||
|
||||
static void error(String message, [Object? error, StackTrace? stackTrace]) {
|
||||
if (kDebugMode) {
|
||||
debugPrint('[ERROR] $message${error != null ? ' : $error' : ''}');
|
||||
if (stackTrace != null) debugPrint(stackTrace.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user