We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1465e46 commit 7243277Copy full SHA for 7243277
packages/dd-trace/src/log/writer.js
@@ -23,10 +23,18 @@ function withNoop (fn) {
23
}
24
25
function unsubscribeAll () {
26
- debugChannel.unsubscribe(onDebug)
27
- infoChannel.unsubscribe(onInfo)
28
- warnChannel.unsubscribe(onWarn)
29
- errorChannel.unsubscribe(onError)
+ if (debugChannel.hasSubscribers) {
+ debugChannel.unsubscribe(onDebug)
+ }
+ if (infoChannel.hasSubscribers) {
30
+ infoChannel.unsubscribe(onInfo)
31
32
+ if (warnChannel.hasSubscribers) {
33
+ warnChannel.unsubscribe(onWarn)
34
35
+ if (errorChannel.hasSubscribers) {
36
+ errorChannel.unsubscribe(onError)
37
38
39
40
function toggleSubscription (enable) {
0 commit comments