- Added the `extra` parameter to the `LoggingInterface` object

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2024-10-04 14:17:25 +02:00
parent dc03f9aac1
commit 4547dd39fe
4 changed files with 20 additions and 7 deletions
+4
View File
@@ -1,3 +1,7 @@
## 1.0.7
- Added the `extra` parameter to the `LoggingInterface`
## 1.0.6+1
- Migrated linting rules to new [arcane_analysis](https://pub.dev/packages/arcane_analysis) package.
@@ -32,5 +32,6 @@ abstract class LoggingInterface {
Map<String, dynamic>? metadata,
Level? level,
StackTrace? stackTrace,
Object? extra,
});
}
+14 -6
View File
@@ -75,33 +75,39 @@ class ArcaneLogger {
///
/// **Parameters:**
///
/// - `message` (String):
/// - `message` ([String]):
/// The main log message to be recorded. This is the primary content that
/// describes the event or state being logged.
///
/// - `module` (String?, _optional_):
/// - `module` ([String?], _optional_):
/// The name of the module where the log originates. If not provided, it will
/// be inferred from the current stack trace. This helps in categorizing logs
/// by different parts of the application.
///
/// - `method` (String?, _optional_):
/// - `method` ([String?], _optional_):
/// The name of the method where the log originates. If not provided, it will
/// be inferred from the current stack trace. This adds context to the log by
/// identifying the specific method generating the log.
///
/// - `level` (Level, _optional_):
/// - `level` ([Level], _optional_):
/// The severity level of the log. Defaults to `Level.debug`. This determines
/// the importance of the log and influences how it is handled and displayed.
///
/// - `stackTrace` (StackTrace?, _optional_):
/// - `stackTrace` ([StackTrace?], _optional_):
/// The stack trace associated with the log event. Useful for error and
/// warning logs to trace the execution path leading to the log event.
///
/// - `metadata` (Map<String, String>?, _optional_):
/// - `metadata` ([Map<String, String>?], _optional_):
/// Additional key-value pairs providing extra context for the log. Commonly
/// used for custom information that can aid in diagnosing issues or
/// understanding the log in context. If not provided, an empty map is used.
///
/// - `extra` ([Object?], _optional_):
/// Allows for passing additional, arbitrary objects of any type into the
/// logging interface. This is a general-purpose object that could be used
/// for anything from passing an [Exception] for additional processing, to
/// any other purpose one could dream up.
///
/// **Details:**
///
/// The `log` method constructs a timestamp and extracts information from the
@@ -135,6 +141,7 @@ class ArcaneLogger {
Level level = Level.debug,
StackTrace? stackTrace,
Map<String, String>? metadata,
Object? extra,
}) {
if (!I._initialized) {
throw Exception("ArcaneLogger has not yet been initialized.");
@@ -174,6 +181,7 @@ class ArcaneLogger {
level: level,
metadata: metadata,
stackTrace: stackTrace,
extra: extra,
);
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
name: arcane_framework
description: "Agnostic Reusable Component Architecture for New Ecosystems: a modern framework for bootstrapping new applications"
version: 1.0.6+1
version: 1.0.7
repository: https://github.com/hanskokx/arcane_framework
issue_tracker: https://github.com/hanskokx/arcane_framework/issues