Files
iiEsaywebUIapp/lib/core/utils/debug_logger.dart
2025-08-20 22:15:26 +05:30

74 lines
1.4 KiB
Dart
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/foundation.dart';
/// Centralized debug logging utility for the entire app
class DebugLogger {
static const bool _enabled = kDebugMode;
/// Log debug information
static void log(String message) {
if (_enabled) {
debugPrint('🔍 $message');
}
}
/// Log errors
static void error(String message, [Object? error]) {
if (_enabled) {
if (error != null) {
debugPrint('$message: $error');
} else {
debugPrint('$message');
}
}
}
/// Log warnings
static void warning(String message) {
if (_enabled) {
debugPrint('⚠️ $message');
}
}
/// Log success/info messages
static void info(String message) {
if (_enabled) {
debugPrint(' $message');
}
}
/// Log navigation events
static void navigation(String message) {
if (_enabled) {
debugPrint('🧭 $message');
}
}
/// Log authentication events
static void auth(String message) {
if (_enabled) {
debugPrint('🔐 $message');
}
}
/// Log streaming events
static void stream(String message) {
if (_enabled) {
debugPrint('📡 $message');
}
}
/// Log validation events
static void validation(String message) {
if (_enabled) {
debugPrint('$message');
}
}
/// Log storage events
static void storage(String message) {
if (_enabled) {
debugPrint('💾 $message');
}
}
}