From 4547dd39fe8ba8189cbe3d26c9c3e14914143cb5 Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Fri, 4 Oct 2024 14:17:25 +0200 Subject: [PATCH] v1.0.7 - Added the `extra` parameter to the `LoggingInterface` object Signed-off-by: Hans Kokx --- CHANGELOG.md | 4 ++++ .../services/logging/logging_interface.dart | 1 + lib/src/services/logging/logging_service.dart | 20 +++++++++++++------ pubspec.yaml | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45eba48..bbfe338 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/src/services/logging/logging_interface.dart b/lib/src/services/logging/logging_interface.dart index 168e4e7..1237d9b 100644 --- a/lib/src/services/logging/logging_interface.dart +++ b/lib/src/services/logging/logging_interface.dart @@ -32,5 +32,6 @@ abstract class LoggingInterface { Map? metadata, Level? level, StackTrace? stackTrace, + Object? extra, }); } diff --git a/lib/src/services/logging/logging_service.dart b/lib/src/services/logging/logging_service.dart index 850db9e..dff5c8c 100644 --- a/lib/src/services/logging/logging_service.dart +++ b/lib/src/services/logging/logging_service.dart @@ -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?, _optional_): + /// - `metadata` ([Map?], _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? 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, ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 16765af..aecfe48 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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