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

Sort of format for CursiveLogWriter #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inferrna
Copy link

@inferrna inferrna commented Dec 23, 2022

Hi. Now it is possible to write like this, so it became kinda flexible.

    Logger::try_with_env_or_str("info")
        .expect("Could not create Logger from environment :(")
        .filter(Box::new(MineOnly))
        .format(my_detailed_format)
        .format_for_writer(my_detailed_format)
        .log_to_file_and_writer(
            flexi_logger::FileSpec::default()
                .directory("logs")
                .suppress_timestamp(),
            cursive_flexi_logger_view::cursive_flexi_logger(&siv)
                .with_format(vec![DATETIME, LEVEL, FileLine, MESSAGE]) //These two lines are optional
                .with_time_format("%R") //without it all intended to work like before
        )
        .start()
        .expect("failed to initialize logger!");

Added (sort of) format for CursiveLogWriter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant