LCOV - code coverage report

Current view
top level - /src - squadron.dart
Test
lcov.info
Date
2022-04-02
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines242596.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'squadron_logger.dart';
2
3/// Squadron "Singleton"
4/// The main application thread and each worker thread will have their own private Squadron singleton
5class Squadron {
60 Squadron._();
7
82 static int _logLevel = SquadronLogLevel.OFF;
9
10 /// Gets the log level. Propagates to workers with the value that is/was set at the time the worker it created. Changes to this property do not propagate by default.
115 static int get logLevel => logger?.logLevel ?? _logLevel;
12
13 /// Sets the log level
142 static set logLevel(int value) {
153 logger?.logLevel = value;
16 _logLevel = value;
171 }
18
19 static SquadronLogger? _logger;
20
21 /// Gets the current logger, if set.
222 static SquadronLogger? get logger => _logger;
23
24 /// Sets the current logger
252 static set logger(SquadronLogger? logger) {
262 final level = logLevel;
27 _logger = logger;
282 _logger?.logLevel = level;
291 }
30
31 static String? _id;
32
33 /// Squadron instance id to track identity of threads/workers
34 /// Returns `<undefined>` if it has not been set yet
352 static String get id => _id ?? '<undefined>';
36
37 /// Sets the Squadron instance id.
38 /// Once set, the id cannot be modified.
392 static setId(String? value) {
401 if (_id == null && value != null) {
412 value = value.trim();
421 if (value.isNotEmpty) {
43 _id ??= value;
44 }
45 }
461 }
47
48 /// Logs a message at [SquadronLogLevel.FINEST] level
493 static void finest(dynamic message) => logger?.finest(message);
50
51 /// Logs a message at [SquadronLogLevel.FINER] level
523 static void finer(dynamic message) => logger?.finer(message);
53
54 /// Logs a message at [SquadronLogLevel.FINE] level
553 static void fine(dynamic message) => logger?.fine(message);
56
57 /// Logs a message at [SquadronLogLevel.CONFIG] level
583 static void config(dynamic message) => logger?.config(message);
59
60 /// Logs a message at [SquadronLogLevel.CONFIG] level
613 static void info(dynamic message) => logger?.info(message);
62
63 /// Logs a message at [SquadronLogLevel.CONFIG] level
643 static void warning(dynamic message) => logger?.warning(message);
65
66 /// Logs a message at [SquadronLogLevel.CONFIG] level
673 static void severe(dynamic message) => logger?.severe(message);
68
69 /// Logs a message at [SquadronLogLevel.CONFIG] level
703 static void shout(dynamic message) => logger?.shout(message);
71}
Choose Features