Added additional documentation and removed Logger dependency

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2024-09-12 11:08:39 +02:00
parent a2b3cbb077
commit 8aca702b79
5 changed files with 96 additions and 5 deletions
@@ -29,8 +29,8 @@ class ArcaneFeatureFlags extends ArcaneService {
///
/// Each feature is represented as an `Enum`. The list holds the features that are
/// currently enabled.
final List<Enum> _enabledFeatures = [];
List<Enum> get enabledFeatures => _enabledFeatures;
final List<Enum> _enabledFeatures = [];
/// Indicates whether the feature flags have been initialized.
bool _initialized = false;
@@ -0,0 +1,57 @@
part of "logging_service.dart";
/// Enum representing the different logging levels used to control logging
/// output.
///
/// Each `Level` has an associated integer value that represents its severity.
/// Logging can be filtered to include only messages above a certain `Level`.
///
/// Example usage:
/// ```dart
/// Arcane.log("This is an info message", level: Level.info);
/// ```
///
/// The levels are as follows:
/// - `all`: Logs all messages, regardless of level.
/// - `trace`: Used for very fine-grained debugging information.
/// - `debug`: Used for general debugging information.
/// - `info`: Used for informational messages.
/// - `warning`: Used for warnings that may indicate potential problems.
/// - `error`: Used for errors that prevent the normal flow of execution.
/// - `fatal`: Used for severe errors that may cause the application to crash.
/// - `off`: Disables logging output entirely.
enum Level {
/// Logs all messages, regardless of severity level.
all(0),
/// Logs very fine-grained debugging information.
trace(1000),
/// Logs general debugging information.
debug(2000),
/// Logs informational messages.
info(3000),
/// Logs warning messages that may indicate potential problems.
warning(4000),
/// Logs error messages that prevent the normal flow of execution.
error(5000),
/// Logs severe errors that may cause the application to crash.
fatal(6000),
/// Disables all logging.
off(10000),
;
/// The integer value representing the severity of the logging level.
///
/// Lower values represent lower severity, while higher values represent
/// higher severity.
final int value;
/// Creates a `Level` with the specified [value].
const Level(this.value);
}
@@ -1,11 +1,9 @@
import "dart:async";
import "package:arcane_framework/arcane_framework.dart";
import "package:arcane_helper_utils/arcane_helper_utils.dart";
import "package:flutter/foundation.dart";
export "package:logger/logger.dart" show Level;
part "logging_enums.dart";
part "logging_interface.dart";
/// A singleton class that manages logging to one or more logging interfaces