Log class
π Log - Advanced Logging for Dart & Flutter π’
This class provides an easy-to-use API for structured logging with emoji-enhanced messages π·οΈ.
π― Understanding the fileName Parameter
- This parameter is mandatory and should represent the file where the log is triggered for better debugging.
- Best Practices for
fileName:- π
fileName: "home_page.dart"β Logs from the main UI - π
fileName: "auth_service.dart"β Authentication logs - π
fileName: "network_service.dart"β Network-related logs
- π
Constructors
- Log({LogRepository? logger})
- π§ Creates an instance of Log
Properties
- hashCode β int
-
The hash code for this object.
no setterinherited
- runtimeType β Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) β dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) β String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) β bool -
The equality operator.
inherited
Static Methods
-
data(
dynamic data, {required String fileName}) β void - β Logs a DATA-level message (Logs structured data)
-
debug(
String message, {required String fileName}) β void - πΊ Logs a DEBUG-level message (Used for debugging)
-
error(
String message, {required String fileName}) β void - π₯ Logs an ERROR-level message (Something went wrong)
-
fatal(
String message, {required String fileName}) β void - π Logs a FATAL-level message (Critical system failure)
-
info(
String message, {required String fileName}) β void - π΅ Logs an INFO-level message (General application events)
-
json(
dynamic jsonData, {required String fileName}) β void - π Logs a JSON-level message (Logs structured JSON data)
-
log(
String message, {required String fileName, LogLevel level = LogLevel.info}) β void - π Internal Log Handler
-
special(
String message, {required String fileName}) β void - π Logs a SPECIAL-level message (For custom logs)
-
warning(
String message, {required String fileName}) β void - π¨ Logs a WARNING-level message (Potential problems)