@@ -46,11 +46,6 @@ class Logger {
46
46
/// All logs with levels below this level will be omitted.
47
47
static Level level = Level .verbose;
48
48
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
-
54
49
final LogFilter _filter;
55
50
final LogPrinter _printer;
56
51
final LogOutput _output;
@@ -117,18 +112,10 @@ class Logger {
117
112
}
118
113
var logEvent = LogEvent (level, message, error, stackTrace);
119
114
if (_filter.shouldLog (logEvent)) {
120
- // NOTE: callbacks are soon to be removed
121
- for (var callback in _logCallbacks) {
122
- callback (logEvent);
123
- }
124
115
var output = _printer.log (logEvent);
125
116
126
117
if (output.isNotEmpty) {
127
118
var outputEvent = OutputEvent (level, output);
128
- // NOTE: callbacks are soon to be removed
129
- for (var callback in _outputCallbacks) {
130
- callback (outputEvent);
131
- }
132
119
_output.output (outputEvent);
133
120
}
134
121
}
@@ -141,32 +128,4 @@ class Logger {
141
128
_printer.destroy ();
142
129
_output.destroy ();
143
130
}
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
- }
172
131
}
0 commit comments