pub struct MasterLogConfig {Show 14 fields
pub api_key: Option<String>,
pub endpoint: Option<String>,
pub timeout: Duration,
pub echo: bool,
pub async_mode: bool,
pub batch_size: usize,
pub flush_interval: Duration,
pub max_queue_size: usize,
pub drop_when_full: bool,
pub queue_timeout: Duration,
pub backpressure: bool,
pub initial_send_seconds_per_log: f64,
pub max_enqueue_sleep: Duration,
pub min_request_interval: Duration,
}Fields§
§api_key: Option<String>§endpoint: Option<String>§timeout: Duration§echo: bool§async_mode: bool§batch_size: usize§flush_interval: Duration§max_queue_size: usize§drop_when_full: bool§queue_timeout: Duration§backpressure: bool§initial_send_seconds_per_log: f64§max_enqueue_sleep: Duration§min_request_interval: DurationImplementations§
Source§impl MasterLogConfig
impl MasterLogConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Examples found in repository?
examples/simple_usage.rs (line 12)
9fn main() {
10 // You can omit this when MASTER_LOG_API_KEY and MASTER_LOG_ENDPOINT are set.
11 configure(
12 MasterLogConfig::from_env()
13 .api_key("dev-key")
14 .endpoint("http://127.0.0.1:8000")
15 .min_request_interval(Duration::from_millis(20))
16 .batch_size(100),
17 );
18
19 mlog("Telescope array online");
20 mlogf!("Captured frame {} for {}", 42, "M31");
21
22 info("Flat-field calibration completed");
23
24 log_entry(
25 LogEntry::new("Dome slit wind threshold approaching")
26 .severity(Severity::Warn)
27 .tags(["dome", "weather"])
28 .metadata(json!({ "wind_knots": 28, "limit_knots": 32 })),
29 );
30
31 warn("Seeing degraded");
32
33 log_entry(
34 LogEntry::with_title("Camera cooling alert", "CCD cooling loop failed to settle")
35 .severity(Severity::Error)
36 .tags(["ccd", "camera"])
37 .metadata(json!({ "setpoint_celsius": -20, "actual_celsius": -16.8 })),
38 );
39
40 error("Mount tracking watchdog tripped");
41
42 let result = flush(Duration::from_secs(5));
43 if !result.ok {
44 eprintln!(
45 "Master Log flush failed: {}",
46 result.error.unwrap_or_default()
47 );
48 }
49}Sourcepub fn api_key(self, value: impl Into<String>) -> Self
pub fn api_key(self, value: impl Into<String>) -> Self
Examples found in repository?
examples/simple_usage.rs (line 13)
9fn main() {
10 // You can omit this when MASTER_LOG_API_KEY and MASTER_LOG_ENDPOINT are set.
11 configure(
12 MasterLogConfig::from_env()
13 .api_key("dev-key")
14 .endpoint("http://127.0.0.1:8000")
15 .min_request_interval(Duration::from_millis(20))
16 .batch_size(100),
17 );
18
19 mlog("Telescope array online");
20 mlogf!("Captured frame {} for {}", 42, "M31");
21
22 info("Flat-field calibration completed");
23
24 log_entry(
25 LogEntry::new("Dome slit wind threshold approaching")
26 .severity(Severity::Warn)
27 .tags(["dome", "weather"])
28 .metadata(json!({ "wind_knots": 28, "limit_knots": 32 })),
29 );
30
31 warn("Seeing degraded");
32
33 log_entry(
34 LogEntry::with_title("Camera cooling alert", "CCD cooling loop failed to settle")
35 .severity(Severity::Error)
36 .tags(["ccd", "camera"])
37 .metadata(json!({ "setpoint_celsius": -20, "actual_celsius": -16.8 })),
38 );
39
40 error("Mount tracking watchdog tripped");
41
42 let result = flush(Duration::from_secs(5));
43 if !result.ok {
44 eprintln!(
45 "Master Log flush failed: {}",
46 result.error.unwrap_or_default()
47 );
48 }
49}Sourcepub fn endpoint(self, value: impl Into<String>) -> Self
pub fn endpoint(self, value: impl Into<String>) -> Self
Examples found in repository?
examples/simple_usage.rs (line 14)
9fn main() {
10 // You can omit this when MASTER_LOG_API_KEY and MASTER_LOG_ENDPOINT are set.
11 configure(
12 MasterLogConfig::from_env()
13 .api_key("dev-key")
14 .endpoint("http://127.0.0.1:8000")
15 .min_request_interval(Duration::from_millis(20))
16 .batch_size(100),
17 );
18
19 mlog("Telescope array online");
20 mlogf!("Captured frame {} for {}", 42, "M31");
21
22 info("Flat-field calibration completed");
23
24 log_entry(
25 LogEntry::new("Dome slit wind threshold approaching")
26 .severity(Severity::Warn)
27 .tags(["dome", "weather"])
28 .metadata(json!({ "wind_knots": 28, "limit_knots": 32 })),
29 );
30
31 warn("Seeing degraded");
32
33 log_entry(
34 LogEntry::with_title("Camera cooling alert", "CCD cooling loop failed to settle")
35 .severity(Severity::Error)
36 .tags(["ccd", "camera"])
37 .metadata(json!({ "setpoint_celsius": -20, "actual_celsius": -16.8 })),
38 );
39
40 error("Mount tracking watchdog tripped");
41
42 let result = flush(Duration::from_secs(5));
43 if !result.ok {
44 eprintln!(
45 "Master Log flush failed: {}",
46 result.error.unwrap_or_default()
47 );
48 }
49}pub fn timeout(self, value: Duration) -> Self
pub fn echo(self, value: bool) -> Self
pub fn async_mode(self, value: bool) -> Self
Sourcepub fn batch_size(self, value: usize) -> Self
pub fn batch_size(self, value: usize) -> Self
Examples found in repository?
examples/simple_usage.rs (line 16)
9fn main() {
10 // You can omit this when MASTER_LOG_API_KEY and MASTER_LOG_ENDPOINT are set.
11 configure(
12 MasterLogConfig::from_env()
13 .api_key("dev-key")
14 .endpoint("http://127.0.0.1:8000")
15 .min_request_interval(Duration::from_millis(20))
16 .batch_size(100),
17 );
18
19 mlog("Telescope array online");
20 mlogf!("Captured frame {} for {}", 42, "M31");
21
22 info("Flat-field calibration completed");
23
24 log_entry(
25 LogEntry::new("Dome slit wind threshold approaching")
26 .severity(Severity::Warn)
27 .tags(["dome", "weather"])
28 .metadata(json!({ "wind_knots": 28, "limit_knots": 32 })),
29 );
30
31 warn("Seeing degraded");
32
33 log_entry(
34 LogEntry::with_title("Camera cooling alert", "CCD cooling loop failed to settle")
35 .severity(Severity::Error)
36 .tags(["ccd", "camera"])
37 .metadata(json!({ "setpoint_celsius": -20, "actual_celsius": -16.8 })),
38 );
39
40 error("Mount tracking watchdog tripped");
41
42 let result = flush(Duration::from_secs(5));
43 if !result.ok {
44 eprintln!(
45 "Master Log flush failed: {}",
46 result.error.unwrap_or_default()
47 );
48 }
49}pub fn flush_interval(self, value: Duration) -> Self
pub fn max_queue_size(self, value: usize) -> Self
pub fn drop_when_full(self, value: bool) -> Self
pub fn queue_timeout(self, value: Duration) -> Self
pub fn backpressure(self, value: bool) -> Self
pub fn initial_send_seconds_per_log(self, value: f64) -> Self
pub fn max_enqueue_sleep(self, value: Duration) -> Self
Sourcepub fn min_request_interval(self, value: Duration) -> Self
pub fn min_request_interval(self, value: Duration) -> Self
Examples found in repository?
examples/simple_usage.rs (line 15)
9fn main() {
10 // You can omit this when MASTER_LOG_API_KEY and MASTER_LOG_ENDPOINT are set.
11 configure(
12 MasterLogConfig::from_env()
13 .api_key("dev-key")
14 .endpoint("http://127.0.0.1:8000")
15 .min_request_interval(Duration::from_millis(20))
16 .batch_size(100),
17 );
18
19 mlog("Telescope array online");
20 mlogf!("Captured frame {} for {}", 42, "M31");
21
22 info("Flat-field calibration completed");
23
24 log_entry(
25 LogEntry::new("Dome slit wind threshold approaching")
26 .severity(Severity::Warn)
27 .tags(["dome", "weather"])
28 .metadata(json!({ "wind_knots": 28, "limit_knots": 32 })),
29 );
30
31 warn("Seeing degraded");
32
33 log_entry(
34 LogEntry::with_title("Camera cooling alert", "CCD cooling loop failed to settle")
35 .severity(Severity::Error)
36 .tags(["ccd", "camera"])
37 .metadata(json!({ "setpoint_celsius": -20, "actual_celsius": -16.8 })),
38 );
39
40 error("Mount tracking watchdog tripped");
41
42 let result = flush(Duration::from_secs(5));
43 if !result.ok {
44 eprintln!(
45 "Master Log flush failed: {}",
46 result.error.unwrap_or_default()
47 );
48 }
49}Trait Implementations§
Source§impl Clone for MasterLogConfig
impl Clone for MasterLogConfig
Source§fn clone(&self) -> MasterLogConfig
fn clone(&self) -> MasterLogConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MasterLogConfig
impl Debug for MasterLogConfig
Auto Trait Implementations§
impl Freeze for MasterLogConfig
impl RefUnwindSafe for MasterLogConfig
impl Send for MasterLogConfig
impl Sync for MasterLogConfig
impl Unpin for MasterLogConfig
impl UnsafeUnpin for MasterLogConfig
impl UnwindSafe for MasterLogConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more