set_global_default use
#1641
-
|
If I move the execution of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Without the code this is difficult to answer, however it may be that a guard returned from a writer does not live long enough. By moving the guard into another function Driving into the code behind [1] tracing/tracing-core/src/dispatch.rs Line 302 in a1868ea |
Beta Was this translation helpful? Give feedback.
Without the code this is difficult to answer, however it may be that a guard returned from a writer does not live long enough. By moving the guard into another function
f, it will at most live as long asfand be dropped at the end of the scope off. If that's the case, you may want to look at this answer: #1494 (comment)Driving into the code behind
set_global_default[1], I would not expect this to occur because of moving justset_global_default. Theset_global_defaultset the defaultDispatchas a static field for the whole process.[1]
tracing/tracing-core/src/dispatch.rs
Line 302 in a1868ea