1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! # Genja Core
//!
//! A network automation library.
//!
//! ## Initialization
//!
//! This library does not initialize logging or other global state.
//! Users must handle initialization in their application.
//!
//! ### Example: Basic Setup
//!
//! ```no_run
//! use genja_core::Settings;
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Load settings
//! let settings = Settings::from_file("config.yaml")?;
//!
//! // Initialize your application with settings
//! // ...
//!
//! Ok(())
//! }
//! ```
//!
//! ### Example: With Logging
//!
//! If you want file-based logging, set it up yourself using the config values:
//!
//! ```no_run
//! use genja_core::Settings;
//! use tracing_subscriber::prelude::*;
//! use tracing_rolling_file::RollingFileAppender;
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let settings = Settings::from_file("config.yaml")?;
//!
//! // Set up logging based on settings
//! if settings.logging().enabled() {
//! let appender = RollingFileAppender::builder()
//! .filename(settings.logging().log_file().to_string())
//! .condition_max_file_size(settings.logging().file_size())
//! .max_filecount(settings.logging().max_file_count())
//! .build()?;
//!
//! let (non_blocking, _guard) = appender.get_non_blocking_appender();
//!
//! tracing_subscriber::registry()
//! .with(tracing_subscriber::fmt::layer().with_writer(non_blocking))
//! .init();
//!
//! // Keep _guard alive for the program duration
//! std::mem::forget(_guard); // Or store it somewhere
//! }
//!
//! // Your application logic
//! Ok(())
//! }
//! ```
pub use async_trait;
pub use ;
pub use genja_task;
pub use Settings;
pub use ;
pub use ;