Skip to content

Commit 8dae0e8

Browse files
committed
Remove callbacks
1 parent a36662e commit 8dae0e8

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

lib/src/logger.dart

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ class Logger {
4646
/// All logs with levels below this level will be omitted.
4747
static Level level = Level.verbose;
4848

49-
// NOTE: callbacks are soon to be removed
50-
static final Set<LogCallback> _logCallbacks = {};
51-
// NOTE: callbacks are soon to be removed
52-
static final Set<OutputCallback> _outputCallbacks = {};
53-
5449
final LogFilter _filter;
5550
final LogPrinter _printer;
5651
final LogOutput _output;
@@ -117,18 +112,10 @@ class Logger {
117112
}
118113
var logEvent = LogEvent(level, message, error, stackTrace);
119114
if (_filter.shouldLog(logEvent)) {
120-
// NOTE: callbacks are soon to be removed
121-
for (var callback in _logCallbacks) {
122-
callback(logEvent);
123-
}
124115
var output = _printer.log(logEvent);
125116

126117
if (output.isNotEmpty) {
127118
var outputEvent = OutputEvent(level, output);
128-
// NOTE: callbacks are soon to be removed
129-
for (var callback in _outputCallbacks) {
130-
callback(outputEvent);
131-
}
132119
_output.output(outputEvent);
133120
}
134121
}
@@ -141,32 +128,4 @@ class Logger {
141128
_printer.destroy();
142129
_output.destroy();
143130
}
144-
145-
/// Register a [LogCallback] which is called for each new [LogEvent].
146-
@Deprecated('Use a custom LogFilter instead')
147-
static void addLogListener(LogCallback callback) {
148-
_logCallbacks.add(callback);
149-
}
150-
151-
/// Removes a [LogCallback] which was previously registered.
152-
///
153-
/// Returns wheter the callback was successfully removed.
154-
@Deprecated('Use a custom LogFilter instead')
155-
static bool removeLogListener(LogCallback callback) {
156-
return _logCallbacks.remove(callback);
157-
}
158-
159-
/// Register an [OutputCallback] which is called for each new [OutputEvent].
160-
@Deprecated('Use a custom LogOutput instead')
161-
static void addOutputListener(OutputCallback callback) {
162-
_outputCallbacks.add(callback);
163-
}
164-
165-
/// Removes a [OutputCallback] which was previously registered.
166-
///
167-
/// Returns wheter the callback was successfully removed.
168-
@Deprecated('Use a custom LogOutput instead')
169-
static void removeOutputListener(OutputCallback callback) {
170-
_outputCallbacks.remove(callback);
171-
}
172131
}

0 commit comments

Comments
 (0)