mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-30 18:27:00 +01:00
craft-testkit: describe where formatting a log message stops at the byte limit
Formatting stops at the first write that would take the message past MAX_BYTES, so a message never passes the limit.
This commit is contained in:
1 parent
0d620e8a6d
commit
fc7882fc96
2 files changed
+4
-4
No files matched your search
@@ -32,7 +32,7 @@ The `log` feature adds `craft_testkit::log` and the `log` dependency. The module
|
||||
|
||||
A capture raises `log::max_level()` to the level it asks for and never lowers it. When the closure panics, the capture on that thread ends and the panic continues. Records from other threads do not appear in a per-thread capture.
|
||||
|
||||
A capture keeps at most `MAX_RECORDS` (4,096) records and `MAX_BYTES` (1 MiB) of message and target text. Formatting a message stops once it passes `MAX_BYTES`. A record over either limit is dropped and counted, and the capture returns `CaptureError::Overflow { dropped }` instead of a partial list. For `drain`, the limits apply to each interval between drains.
|
||||
A capture keeps at most `MAX_RECORDS` (4,096) records and `MAX_BYTES` (1 MiB) of message and target text. Formatting a message stops at the first write that would take it past `MAX_BYTES`. A record over either limit is dropped and counted, and the capture returns `CaptureError::Overflow { dropped }` instead of a partial list. For `drain`, the limits apply to each interval between drains.
|
||||
|
||||
Run process-wide captures in a binary of their own, for example a `[[test]]` with `harness = false`:
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
//! capture filters by its own level.
|
||||
//!
|
||||
//! A capture keeps at most [`MAX_RECORDS`] records and [`MAX_BYTES`] bytes of message and target
|
||||
//! text. Formatting a message stops once it passes [`MAX_BYTES`]. A record over either limit is
|
||||
//! dropped and counted, and the capture then returns [`CaptureError::Overflow`] with the number
|
||||
//! dropped instead of a partial list.
|
||||
//! text. Formatting a message stops at the first write that would take it past [`MAX_BYTES`]. A
|
||||
//! record over either limit is dropped and counted, and the capture then returns
|
||||
//! [`CaptureError::Overflow`] with the number dropped instead of a partial list.
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::fmt;
|
||||
|
||||
Reference in new issue
Block a user