MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / init_logger

Function init_logger

src/lib.rs:19–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17use once_cell::sync::OnceCell;
18
19pub fn init_logger() -> Result<()> {
20 let deopt = Deopt::new(get_library_name())?;
21 let log_file = FileSpec::default()
22 .directory(deopt.get_library_output_dir()?)
23 .basename("fuzzer")
24 .use_timestamp(true);
25 flexi_logger::Logger::try_with_env_or_str("debug")?
26 .format_for_files(opt_format)
27 .log_to_file(log_file)
28 .duplicate_to_stdout(flexi_logger::Duplicate::Debug)
29 .rotate(
30 flexi_logger::Criterion::Size(1 << 30),
31 Naming::Timestamps,
32 flexi_logger::Cleanup::KeepLogFiles(3),
33 )
34 .start()?;
35 Ok(())
36}
37
38pub fn init_debug_logger() -> Result<()> {
39 flexi_logger::Logger::try_with_env_or_str("debug")?

Callers 1

mainFunction · 0.85

Calls 2

get_library_nameFunction · 0.85

Tested by

no test coverage detected