docs: fix console=True stream claim, stdout -> stderr (StreamHandler default)
Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -29,7 +29,7 @@ from log_setup import setup_logging
|
||||
setup_logging(name="run", level="INFO") # daily rotation, logs/ dir, gzip (file only)
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
log.info("started") # -> ./run.log (add console=True for stdout too)
|
||||
log.info("started") # -> ./run.log (add console=True for stderr too)
|
||||
```
|
||||
|
||||
Call it once, at the app's entry point — before the rest of the app runs. Every module
|
||||
@@ -57,7 +57,7 @@ emits; the records land in the configured root.
|
||||
- **Retention** = `backup_count` (default 14) for every mode — unless tiered retention is
|
||||
enabled (below). For `rotate="size"`, `backup_count=0` is "keep none" (not "disable
|
||||
rotation") — see the `size` bullet above and the note at the bottom of this section.
|
||||
- **console=True** (off by default) also logs to stdout in the same format — opt in when
|
||||
- **console=True** (off by default) also logs to stderr in the same format — opt in when
|
||||
you want live terminal output alongside the file.
|
||||
|
||||
The `name` you pass is normalized so it produces exactly one `.log`: `name="latest"` and
|
||||
@@ -174,7 +174,7 @@ setup_logging(
|
||||
keep_compressed=None, # tiered: next M rolled logs kept GZIPPED (opt-in)
|
||||
max_bytes=10_000_000, # only for rotate="size"
|
||||
compress=True, # gzip rolled files
|
||||
console=False, # also log to stdout (off by default; opt in)
|
||||
console=False, # also log to stderr (off by default; opt in)
|
||||
queue=False, # route through a background QueueListener (async-friendly)
|
||||
output="text", # "text" (human, local time) | "json" (structured, UTC)
|
||||
fmt=None, # override the text format string (text mode only)
|
||||
|
||||
Reference in New Issue
Block a user