diff --git a/appenders/async/README.md b/appenders/async/README.md index 3aa986e2..f0c5e89f 100644 --- a/appenders/async/README.md +++ b/appenders/async/README.md @@ -41,15 +41,15 @@ On each `Append::append` call, `Async` snapshots the record payload, structured | :------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | `max_buffered_records(n)` | Limits buffered pending records to `n` (`NonZeroUsize`). When omitted, buffering is unbounded. | | `overflow_block()` | Blocks the calling thread when the record buffer is full until space frees up (default). | -| `overflow_drop_incoming()` | Drops incoming log records without error when the record buffer is full; `flush` still blocks until all previously buffered records complete. | -| `error_sink(sink)` | Routes worker-side `Append` errors and caught panics to `sink` (default: `StderrErrorSink`) without terminating the worker thread. | -| `append(appender)` | Registers a downstream `Append` driven sequentially on the worker thread (skipping thread creation when no appenders are registered). | +| `overflow_drop_incoming()` | Drops incoming log records without error when the record buffer is full; `AsyncGuard::flush` still blocks until all previously buffered records complete. | +| `error_sink(sink)` | Routes worker-side `Append` errors and caught panics to `sink` (default: `StderrErrorSink`) without terminating the worker thread. | +| `append(appender)` | Registers a downstream `Append` driven sequentially on the worker thread (skipping thread creation when no appenders are registered). | ## Flushing and shutdown - `Async` is cheaply `Clone`able so multiple dispatch branches or channel loggers can share one worker queue without wrapping `Async` in an `Arc`. -- `AsyncGuard::flush` (and `Append::flush` on `Async`) enqueues a barrier onto the worker queue (blocking even under `overflow_drop_incoming`) and waits until all preceding records have been processed and every inner appender has completed `Append::flush`. -- Dropping `AsyncGuard` signals shutdown, drains all pending records, flushes every inner appender, and joins the worker thread (unless dropped on the worker thread itself), even when `Logger` handles remain alive in `static` items at process exit. +- `AsyncGuard::flush` enqueues a barrier onto the worker queue (blocking even under `overflow_drop_incoming`) and waits until all preceding records have been processed. +- Dropping `AsyncGuard` signals shutdown, drains all pending records, and joins the worker thread (unless dropped on the worker thread itself), even when `Logger` handles remain alive in `static` items at process exit. The single-worker queue design is adapted from [`spdlog-rs`'s `AsyncPoolSink`](https://docs.rs/spdlog-rs/0.5.3/spdlog/sink/struct.AsyncPoolSink.html), simplified to a single ordered drain thread with synchronous `flush` barriers. diff --git a/appenders/async/src/lib.rs b/appenders/async/src/lib.rs index 31c6ffb1..f7a9001f 100644 --- a/appenders/async/src/lib.rs +++ b/appenders/async/src/lib.rs @@ -28,9 +28,9 @@ //! - **Fault isolation**: operational errors and panics inside worker-side appenders are caught and //! routed to [`AsyncBuilder::error_sink`] (default: [`StderrErrorSink`]) without terminating the //! worker thread. -//! - **Ordered flushing and shutdown**: [`Append::flush`] waits for all queued records ahead of it -//! to be written and flushed; dropping [`AsyncGuard`] drains pending records, flushes the inner -//! appenders, and joins the worker when dropped outside the worker thread. +//! - **Queue draining and shutdown**: [`AsyncGuard::flush`] waits for the worker to process all +//! previously queued records. Dropping [`AsyncGuard`] drains pending records and joins the worker +//! when dropped outside the worker thread. //! //! # Examples //! @@ -84,10 +84,10 @@ use logforth_core::record::RecordOwned; /// /// # Flushing and Shutdown /// -/// [`Append::flush`] enqueues a barrier and blocks until all previously queued records have been -/// appended and every inner appender has been flushed. Keep the associated [`AsyncGuard`] in `main` -/// to drain pending records at shutdown, including when the logger lives in a `static`. After the -/// guard is dropped, appending through any clone returns an error. +/// [`AsyncGuard::flush`] waits for the worker to process all previously queued records. +/// Keep the associated [`AsyncGuard`] in `main` to drain pending records at shutdown, including +/// when the logger lives in a `static`. After the guard is dropped, appending through any clone +/// returns an error. /// /// # Examples /// @@ -128,18 +128,11 @@ impl Append for Async { })); sender.send_log(task) } - - fn flush(&self) -> Result<(), Error> { - if self.shutdown.load(Ordering::Acquire) { - return Ok(()); - } - flush_worker(self.sender.as_ref()) - } } -/// Owns the async worker's lifetime. Dropping the guard drains pending records and flushes -/// downstream appenders. The caller waits for the worker to exit unless it is the worker itself. -#[must_use = "dropping the guard flushes pending records and joins the async worker thread; bind it in main (for example, `let _guard = ...`)"] +/// Owns the async worker's lifetime. Dropping the guard drains pending records and joins the +/// worker thread unless the guard is dropped on the worker itself. +#[must_use = "dropping the guard drains pending records and joins the async worker thread; bind it in main (for example, `let _guard = ...`)"] #[derive(Debug)] pub struct AsyncGuard { sender: Option, @@ -148,7 +141,7 @@ pub struct AsyncGuard { } impl AsyncGuard { - /// Waits until all previously queued records are processed and inner appenders are flushed. + /// Waits until all previously queued records have been processed by the worker. /// /// # Errors /// @@ -245,8 +238,8 @@ impl AsyncBuilder { /// Configures [`Append::append`] to drop incoming records without error when the record buffer /// is full. /// - /// [`Append::flush`] still blocks until space is available and all previously buffered records - /// have been processed. Has no effect when [`AsyncBuilder::max_buffered_records`] is not set. + /// [`AsyncGuard::flush`] still waits for the worker to process all previously queued records. + /// This policy has no effect when [`AsyncBuilder::max_buffered_records`] is not set. pub fn overflow_drop_incoming(mut self) -> Self { self.overflow = Overflow::DropIncoming; self @@ -404,15 +397,6 @@ fn sink_error(error_sink: &dyn ErrorSink, err: &Error) { let _ = catch_unwind(AssertUnwindSafe(|| error_sink.sink(err))); } -fn flush_appends(appends: &[Box], error_sink: &dyn ErrorSink) { - for append in appends { - if let Err(err) = catch_panic(|| append.flush()) { - let err = Error::new("failed to flush appender").with_source(err); - sink_error(error_sink, &err); - } - } -} - fn run_worker( receiver: mpsc::Receiver, appends: Vec>, @@ -432,7 +416,6 @@ fn run_worker( }); } Task::Flush { done } => { - flush_appends(&appends, &*error_sink); let _ = done.send(()); } Task::Shutdown => {} @@ -445,7 +428,6 @@ fn run_worker( break; } } - flush_appends(&appends, &*error_sink); } fn catch_panic(f: impl FnOnce() -> Result<(), Error>) -> Result<(), Error> { diff --git a/appenders/opentelemetry/README.md b/appenders/opentelemetry/README.md index b128e5fd..6e5069ed 100644 --- a/appenders/opentelemetry/README.md +++ b/appenders/opentelemetry/README.md @@ -75,7 +75,7 @@ By default, `OpentelemetryLog` enforces unique top-level attribute keys per the ## Usage notes - **Sharing a provider and custom processors**: Configure `Resource`, `SimpleLogProcessor`, or `BatchLogProcessor` (`BatchConfigBuilder`) on `SdkLoggerProvider::builder()`, then clone `provider` into each `OpentelemetryLog::new(scope, provider.clone())` channel. -- **Provider lifecycle and `static` loggers**: Retain a `provider` clone to call `provider.force_flush()` on demand or `provider.shutdown()` before process exit (`Append::flush` also delegates to `SdkLoggerProvider::force_flush`). While `SdkLoggerProvider` shuts down automatically when its last reference drops, `static` loggers never drop at exit and therefore require an explicit `provider.shutdown()`. +- **Provider lifecycle and `static` loggers**: Retain a `provider` clone to call `provider.force_flush()` on demand or `provider.shutdown()` before process exit. While `SdkLoggerProvider` shuts down automatically when its last reference drops, `static` loggers never drop at exit and therefore require an explicit `provider.shutdown()`. - **Trace-log correlation**: Pair `OpentelemetryLog` with [`logforth-diagnostic-fastrace`](https://crates.io/crates/logforth-diagnostic-fastrace) (`FastraceDiagnostic`) or any `Diagnostic` emitting `"trace_id"` (32-digit non-zero hex) and `"span_id"` (16-digit non-zero hex), plus optional boolean `"sampled"`, to populate `LogRecord::set_trace_context`. - **Filter exporter transport targets at `DEBUG` / `TRACE`**: When bridging global `log` output at `DEBUG` or `TRACE`, raise thresholds for your exporter's transport crates (such as `reqwest`, `h2`, `hyper`, `tonic`, and `tower`) to `WARN` to avoid log amplification outside the SDK batch worker thread. - **Custom body construction (`MakeBody` vs. `MakeBodyLayout`)**: `MakeBody` can construct any `AnyValue` (`String`, `Map`, `ListAny`, `Bytes`, or scalar). Because `Layout::format` outputs `Vec`, `MakeBodyLayout` emits `AnyValue::Bytes` (OTLP `bytes_value`, rendered as Base64 in backends like Grafana Loki); implement `MakeBody` directly to emit UTF-8 `AnyValue::String` or structured `AnyValue` bodies. diff --git a/appenders/opentelemetry/src/lib.rs b/appenders/opentelemetry/src/lib.rs index 90931a3f..d0c52fcd 100644 --- a/appenders/opentelemetry/src/lib.rs +++ b/appenders/opentelemetry/src/lib.rs @@ -112,7 +112,6 @@ const KEY_SAMPLED: &str = "sampled"; #[derive(Debug)] pub struct OpentelemetryLog { logger: SdkLogger, - provider: SdkLoggerProvider, make_body: Option>, allow_duplicate_keys: bool, } @@ -141,7 +140,6 @@ impl OpentelemetryLog { let logger = provider.logger_with_scope(scope); OpentelemetryLog { logger, - provider, make_body: None, allow_duplicate_keys: false, } @@ -290,12 +288,6 @@ impl Append for OpentelemetryLog { self.logger.emit(log_record); Ok(()) } - - fn flush(&self) -> Result<(), Error> { - self.provider - .force_flush() - .map_err(|err| Error::new("failed to flush records").with_source(err)) - } } fn add_source_location( diff --git a/appenders/syslog/src/socket.rs b/appenders/syslog/src/socket.rs index 666261f2..062d98df 100644 --- a/appenders/syslog/src/socket.rs +++ b/appenders/syslog/src/socket.rs @@ -348,14 +348,6 @@ impl Append for SocketSyslog { .send(&wire_buf) .map_err(|err| Error::new("failed to send syslog message").with_source(err)) } - - fn flush(&self) -> Result<(), Error> { - self.sender - .lock() - .unwrap_or_else(|e| e.into_inner()) - .flush() - .map_err(|err| Error::new("failed to flush syslog sender").with_source(err)) - } } impl Drop for SocketSyslog { diff --git a/core/src/append/mod.rs b/core/src/append/mod.rs index 7c81a348..000bb521 100644 --- a/core/src/append/mod.rs +++ b/core/src/append/mod.rs @@ -47,15 +47,6 @@ pub trait Append: fmt::Debug + Send + Sync + 'static { /// /// Returns an [`Error`] if formatting, encoding, or writing the record fails. fn append(&self, record: &Record, diags: &dyn Diagnostic) -> Result<(), Error>; - - /// Flushes any buffered records to the underlying destination. The default does nothing. - /// - /// # Errors - /// - /// Returns an [`Error`] if flushing buffered output fails. - fn flush(&self) -> Result<(), Error> { - Ok(()) - } } impl From for Box { @@ -68,18 +59,10 @@ impl Append for Arc { fn append(&self, record: &Record, diags: &dyn Diagnostic) -> Result<(), Error> { (**self).append(record, diags) } - - fn flush(&self) -> Result<(), Error> { - (**self).flush() - } } impl Append for &'static T { fn append(&self, record: &Record, diags: &dyn Diagnostic) -> Result<(), Error> { (**self).append(record, diags) } - - fn flush(&self) -> Result<(), Error> { - (**self).flush() - } } diff --git a/core/src/append/stdio.rs b/core/src/append/stdio.rs index 0d2740c5..c4f119e9 100644 --- a/core/src/append/stdio.rs +++ b/core/src/append/stdio.rs @@ -79,13 +79,6 @@ impl Append for Stdout { .map_err(|err| Error::new("failed to write to stdout").with_source(err))?; Ok(()) } - - fn flush(&self) -> Result<(), Error> { - std::io::stdout() - .flush() - .map_err(|err| Error::new("failed to flush stdout").with_source(err))?; - Ok(()) - } } /// An appender that writes formatted log records followed by `\n` to standard error. diff --git a/core/src/error/sink.rs b/core/src/error/sink.rs index 5496dc5c..5d6127e9 100644 --- a/core/src/error/sink.rs +++ b/core/src/error/sink.rs @@ -20,7 +20,7 @@ use crate::Error; /// A terminal sink that processes internal runtime errors produced by the logging pipeline. /// /// Logging operations are designed not to crash the host application at runtime. When an appender -/// fails to emit or flush records, execution roots such as [`Logger`](crate::Logger) or asynchronous +/// fails to emit records, execution roots such as [`Logger`](crate::Logger) or asynchronous /// workers forward the resulting [`Error`] to their configured [`ErrorSink`]. /// /// Because [`ErrorSink`] is the final stage of error handling, implementations operate on a diff --git a/core/src/logger/builder.rs b/core/src/logger/builder.rs index 5881621a..35b1a9f2 100644 --- a/core/src/logger/builder.rs +++ b/core/src/logger/builder.rs @@ -93,7 +93,7 @@ impl LoggerBuilder { self } - /// Sets the logger's [`ErrorSink`] for append and flush failures. + /// Sets the logger's [`ErrorSink`] for append failures. /// /// Defaults to [`StderrErrorSink`]. /// diff --git a/tests-integration/src/lib.rs b/tests-integration/src/lib.rs index ee1beff5..7d17789d 100644 --- a/tests-integration/src/lib.rs +++ b/tests-integration/src/lib.rs @@ -16,8 +16,6 @@ use std::sync::Arc; use std::sync::Mutex; -use std::sync::atomic::AtomicUsize; -use std::sync::atomic::Ordering; use logforth_core::Append; use logforth_core::Diagnostic; @@ -48,10 +46,9 @@ pub struct CapturedEvent { struct RecordingState { layout: Box, events: Mutex>, - flushes: AtomicUsize, } -/// A thread-safe in-memory [`Append`] test double that records events and flush calls. +/// A thread-safe in-memory [`Append`] test double that records events. #[derive(Debug, Clone)] pub struct RecordingAppender { state: Arc, @@ -70,7 +67,6 @@ impl RecordingAppender { state: Arc::new(RecordingState { layout: layout.into(), events: Mutex::new(Vec::new()), - flushes: AtomicUsize::new(0), }), } } @@ -105,11 +101,6 @@ impl RecordingAppender { }) .collect() } - - /// Returns the number of `flush` calls observed. - pub fn flush_count(&self) -> usize { - self.state.flushes.load(Ordering::Acquire) - } } impl Append for RecordingAppender { @@ -126,11 +117,6 @@ impl Append for RecordingAppender { self.state.events.lock().unwrap().push(event); Ok(()) } - - fn flush(&self) -> Result<(), Error> { - self.state.flushes.fetch_add(1, Ordering::Release); - Ok(()) - } } /// An [`Append`] test double that always fails with a fixed message. @@ -140,8 +126,7 @@ pub struct FailingAppender { } impl FailingAppender { - /// Creates a new [`FailingAppender`] that returns `Error::new(message)` on `append` and - /// `flush`. + /// Creates a new [`FailingAppender`] that returns `Error::new(message)` on `append`. pub const fn new(message: &'static str) -> Self { Self { message } } @@ -151,10 +136,6 @@ impl Append for FailingAppender { fn append(&self, _: &Record, _: &dyn Diagnostic) -> Result<(), Error> { Err(Error::new(self.message)) } - - fn flush(&self) -> Result<(), Error> { - Err(Error::new(self.message)) - } } /// A [`Diagnostic`] test double that always fails with a fixed message. diff --git a/tests-integration/tests/append_test/asynchronous.rs b/tests-integration/tests/append_test/asynchronous.rs index 31dbc6b9..8ea51b36 100644 --- a/tests-integration/tests/append_test/asynchronous.rs +++ b/tests-integration/tests/append_test/asynchronous.rs @@ -72,8 +72,6 @@ fn async_appender_preserves_callsite_context_fans_out_in_order_and_flushes_on_dr } guard.flush().unwrap(); - assert_eq!(first_sink.flush_count(), 1); - assert_eq!(second_sink.flush_count(), 1); let events = first_sink.events(); assert_eq!(events.len(), 2); @@ -107,8 +105,6 @@ fn async_appender_preserves_callsite_context_fans_out_in_order_and_flushes_on_dr "closing listener" ], ); - assert_eq!(first_sink.flush_count(), 2); - assert_eq!(second_sink.flush_count(), 2); } #[derive(Debug)] @@ -116,9 +112,6 @@ struct GatedAppender { entered_append_tx: mpsc::Sender<()>, append_gate: Arc, block_first_append: AtomicBool, - entered_flush_tx: mpsc::Sender<()>, - flush_gate: Arc, - block_flush: AtomicBool, seen: Arc>>, } @@ -131,34 +124,21 @@ impl Append for GatedAppender { self.seen.lock().unwrap().push(record.payload().to_string()); Ok(()) } - - fn flush(&self) -> Result<(), Error> { - if self.block_flush.swap(false, Ordering::AcqRel) { - self.entered_flush_tx.send(()).unwrap(); - self.flush_gate.wait(); - } - Ok(()) - } } #[test] fn async_appender_blocks_flush_and_sheds_load_under_drop_incoming() { let (entered_append_tx, entered_append_rx) = mpsc::channel(); - let (entered_flush_tx, entered_flush_rx) = mpsc::channel(); let append_gate = Arc::new(Barrier::new(2)); - let flush_gate = Arc::new(Barrier::new(2)); let seen = Arc::new(Mutex::new(Vec::new())); - let (async_append, _guard) = AsyncBuilder::new("it-async-backpressure") + let (async_append, guard) = AsyncBuilder::new("it-async-backpressure") .max_buffered_records(NonZeroUsize::new(1).unwrap()) .overflow_drop_incoming() .append(GatedAppender { entered_append_tx, append_gate: append_gate.clone(), block_first_append: AtomicBool::new(true), - entered_flush_tx, - flush_gate: flush_gate.clone(), - block_flush: AtomicBool::new(true), seen: seen.clone(), }) .build() @@ -181,17 +161,17 @@ fn async_appender_blocks_flush_and_sheds_load_under_drop_incoming() { emit("second"); emit("dropped"); - let flush_target = async_append.clone(); - let flush_thread = thread::spawn(move || flush_target.flush()); - - // Release record 1 so record 2 drains and the worker reaches the flush barrier. - append_gate.wait(); - entered_flush_rx.recv().unwrap(); - let finished_before_gate = flush_thread.is_finished(); - - flush_gate.wait(); - assert!(!finished_before_gate); - flush_thread.join().unwrap().unwrap(); + let started = Barrier::new(2); + thread::scope(|scope| { + let flush_thread = scope.spawn(|| { + started.wait(); + guard.flush().unwrap(); + }); + started.wait(); + assert!(!flush_thread.is_finished()); + append_gate.wait(); + flush_thread.join().unwrap(); + }); assert_eq!(*seen.lock().unwrap(), vec!["first", "second"]); } @@ -210,10 +190,6 @@ impl Append for PanickingAppender { _ => Ok(()), } } - - fn flush(&self) -> Result<(), Error> { - panic!("flush panic"); - } } #[derive(Debug)] @@ -268,19 +244,18 @@ fn async_appender_isolates_worker_errors_and_panics_and_surfaces_callsite_diag_e logforth::info!(logger, "m4"); guard.flush().unwrap(); - // All four records still reached the healthy sibling appender and flushed cleanly. + // All four records still reached the healthy sibling appender. assert_eq!(healthy_sink.payloads(), vec!["m1", "m2", "m3", "m4"]); - assert_eq!(healthy_sink.flush_count(), 1); // First error (`m1` static panic) triggered the one-shot `ErrorSink` panic without killing - // the worker; all subsequent append and flush failures were recorded. - assert_eq!(worker_errors.errors().len(), 8); + // the worker; all subsequent append failures were recorded. + assert_eq!(worker_errors.errors().len(), 6); } #[derive(Debug)] struct SelfDroppingAppender { holder: Arc>>, - flushed_tx: mpsc::Sender<()>, + done_tx: mpsc::Sender<()>, } impl Append for SelfDroppingAppender { @@ -288,10 +263,11 @@ impl Append for SelfDroppingAppender { drop(self.holder.lock().unwrap().take()); Ok(()) } +} - fn flush(&self) -> Result<(), Error> { - let _ = self.flushed_tx.send(()); - Ok(()) +impl Drop for SelfDroppingAppender { + fn drop(&mut self) { + let _ = self.done_tx.send(()); } } @@ -315,14 +291,14 @@ fn async_appender_validates_thread_name_skips_empty_worker_and_handles_reentrant inert_guard.flush().unwrap(); let holder = Arc::new(Mutex::new(None)); - let (flushed_tx, flushed_rx) = mpsc::channel(); + let (done_tx, done_rx) = mpsc::channel(); let sink = RecordingAppender::default(); let (reentrant, guard) = AsyncBuilder::new("it-async-reentrant-drop") .max_buffered_records(NonZeroUsize::new(1).unwrap()) .append(sink.clone()) .append(SelfDroppingAppender { holder: holder.clone(), - flushed_tx, + done_tx, }) .build() .unwrap(); @@ -339,7 +315,7 @@ fn async_appender_validates_thread_name_skips_empty_worker_and_handles_reentrant .unwrap(); } } - flushed_rx.recv().unwrap(); + done_rx.recv().unwrap(); assert_eq!(sink.payloads(), ["first", "queued"]); assert!( reentrant diff --git a/tests-integration/tests/append_test/opentelemetry.rs b/tests-integration/tests/append_test/opentelemetry.rs index abdda192..53b021ee 100644 --- a/tests-integration/tests/append_test/opentelemetry.rs +++ b/tests-integration/tests/append_test/opentelemetry.rs @@ -74,7 +74,7 @@ fn opentelemetry_appender_preserves_event_timestamp_maps_all_levels_and_shuts_do .build(); let appender = OpentelemetryLog::new( InstrumentationScope::builder("scope-service").build(), - provider, + provider.clone(), ); let historical_time = SystemTime::UNIX_EPOCH + Duration::from_secs(1_700_000_000); @@ -110,7 +110,8 @@ fn opentelemetry_appender_preserves_event_timestamp_maps_all_levels_and_shuts_do ) .unwrap(); - appender.flush().unwrap(); + provider.force_flush().unwrap(); + drop(provider); let logs = exporter.get_emitted_logs().unwrap(); assert_eq!(logs.len(), 1 + Level::ALL.len() + 2); @@ -333,11 +334,11 @@ fn opentelemetry_appender_extracts_trace_context_and_preserves_incomplete_or_inv .build(); let appender = OpentelemetryLog::new( InstrumentationScope::builder("trace-scope").build(), - provider, + provider.clone(), ); let emit = |record: &Record, diags: &dyn Diagnostic| { appender.append(record, diags).unwrap(); - appender.flush().unwrap(); + provider.force_flush().unwrap(); let log = exporter.get_emitted_logs().unwrap().pop().unwrap(); exporter.reset(); log.record diff --git a/tests-integration/tests/append_test/syslog.rs b/tests-integration/tests/append_test/syslog.rs index ff7689f9..3ea4147a 100644 --- a/tests-integration/tests/append_test/syslog.rs +++ b/tests-integration/tests/append_test/syslog.rs @@ -334,7 +334,6 @@ fn tls_flushes_octet_counted_records_and_reconnects_after_failure() { second.set_read_timeout(TIMEOUT).unwrap(); second.read_exact(&mut frame).unwrap(); assert_eq!(frame, expected.as_bytes()); - appender.flush().unwrap(); } #[cfg(unix)] diff --git a/tests-integration/tests/bridge_test/log.rs b/tests-integration/tests/bridge_test/log.rs index 84a89848..c4026429 100644 --- a/tests-integration/tests/bridge_test/log.rs +++ b/tests-integration/tests/bridge_test/log.rs @@ -98,7 +98,6 @@ fn max_level_accessors_enabled_and_flush() { assert_eq!(appender.payloads(), ["bridge"]); bridge.flush(); - assert_eq!(appender.flush_count(), 0); bridge.logger().log( &RecordBuilder::new() .level(Level::Info) diff --git a/tests-integration/tests/core_test/diagnostics.rs b/tests-integration/tests/core_test/diagnostics.rs index fc295722..7a05de3b 100644 --- a/tests-integration/tests/core_test/diagnostics.rs +++ b/tests-integration/tests/core_test/diagnostics.rs @@ -83,10 +83,6 @@ impl Append for ScopedDecorator { let chained: [&dyn Diagnostic; 2] = [diags, &extra]; self.inner.append(record, &chained) } - - fn flush(&self) -> Result<(), Error> { - self.inner.flush() - } } #[test] diff --git a/tests-integration/tests/core_test/logger.rs b/tests-integration/tests/core_test/logger.rs index b01306c1..72129c5b 100644 --- a/tests-integration/tests/core_test/logger.rs +++ b/tests-integration/tests/core_test/logger.rs @@ -465,15 +465,11 @@ fn arc_and_static_forwarding_share_all_five_traits_across_dispatches() { "arc:drop-static tenant=acme", ] ); - Append::flush(&arc_append).unwrap(); - assert_eq!(arc_append.flush_count(), 1); assert_eq!( STATIC_APPEND.lines(), ["static:keep origin=static", "static:drop-arc origin=static"] ); - Append::flush(&&*STATIC_APPEND).unwrap(); - assert_eq!(STATIC_APPEND.flush_count(), 1); let static_errors = STATIC_ERROR_SINK.errors(); assert_eq!(static_errors.len(), 2); assert!( diff --git a/tests-integration/tests/core_test/macros.rs b/tests-integration/tests/core_test/macros.rs index 8d69c2b9..ffd0f292 100644 --- a/tests-integration/tests/core_test/macros.rs +++ b/tests-integration/tests/core_test/macros.rs @@ -96,9 +96,6 @@ fn all_macro_levels_and_argument_forms_capture_callsite_location_and_fields() { logforth_core::fatal!(logger, ["fatal" = true], "fatal event"); logforth_core::log!(logger, Level::Info3, ["custom" = 3], "custom level"); - // `fatal!` records severity metadata only and never triggers `flush`. - assert_eq!(sink.flush_count(), 0); - let events = sink.events(); assert_eq!(events.len(), 7);