Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedDispatch type is not accessible #125

Open
Luro02 opened this issue Mar 29, 2023 · 2 comments
Open

SharedDispatch type is not accessible #125

Luro02 opened this issue Mar 29, 2023 · 2 comments
Assignees
Labels

Comments

@Luro02
Copy link

Luro02 commented Mar 29, 2023

I can call fern::Dispatch::into_shared, but when I try to return it from a function:

fn setup_logger(output: fern::Output) -> fern::SharedDispatch {
    let shared = fern::Dispatch::new()
        .into_shared();
    return shared;
}

I get an error.

error[E0412]: cannot find type `SharedDispatch` in crate `fern`
   --> runner\src\main.rs:279:49
    |
279 | fn setup_logger(output: fern::Output) -> fern::SharedDispatch {
    |                                                ^^^^^^^^^^^^^^ not found in `fern`

For more information about this error, try `rustc --explain E0412`.

The type cannot be clicked on in the docs as well:
https://docs.rs/fern/latest/fern/struct.Dispatch.html#method.into_shared

I guess one has forgotten to export the type?

fern/src/lib.rs

Lines 266 to 270 in 4f45ef9

pub use crate::{
builders::{Dispatch, Output, Panic},
errors::InitError,
log_impl::FormatCallback,
};

@daboross daboross added the bug label Mar 30, 2023
@daboross daboross self-assigned this Mar 30, 2023
@timothyhutz
Copy link

@daboross Python guy here practicing my hand at Rust would like to take a stab at this and submit a PR for a fix.

@timothyhutz
Copy link

Here is my PR that should fix the public visibility of that struct in the crate
#133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants