Correct type for storing a relaod_handle in a struct #1591
Unanswered
akanalytics
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im trying to hold a reload_handle for a FmtSubscriber in a struct so I can later use the reload/modify methods to change level.
Because Im using stderr (my program uses stdout for its output), the type Handle<EnvFilter, Formatter> doesnt seem to work.
Ideally I'd just like to Box the reload_handle, as reloading is not a performance critical part, and it would remove excessive genrics from MyStruct.
struct MyStruct {
handle: WhatTypeHere,
}
let builder = FmtSubscriber::builder()
.with_writer(io::stderr)
.with_env_filter(EnvFilter::from_default_env())
.with_filter_reloading();
let reload_handle = builder.reload_handle();
let my_struct = MyStruct {
handle: reload_handle,
}
Beta Was this translation helpful? Give feedback.
All reactions