Summary
rfl.log.setup_logger currently attaches a single logging.StreamHandler() with no stream argument, so all accepted records go to stderr.
For container/CLI usage it is useful to follow the common split:
- levels below WARNING (DEBUG, INFO) → stdout
- WARNING and above → stderr
That keeps operational noise off stderr (so tools that treat stderr as “errors only” stay quiet) while preserving WARNING/ERROR/CRITICAL on stderr.
Current behavior
In setup_logger, after resolving the root level and flag filter, RFL does roughly:
handler = logging.StreamHandler() # defaults to sys.stderr
handler.setLevel(logging_level)
# … formatter + component flag filter …
root_logger.addHandler(handler)
There is no API to choose streams or to split by level.
Proposed behavior
When enabled (exact API TBD), setup_logger would configure two stream handlers sharing the existing formatter and log_flags / debug_flags filter:
| Handler stream |
Records |
sys.stdout |
levelno < logging.WARNING (and still gated by the configured level) |
sys.stderr |
levelno >= logging.WARNING (handler level at least WARNING) |
Configured level / debug semantics and component flag filtering should stay unchanged; only the destination stream would change.
Suggested API
Backward-compatible options, e.g.:
split_streams: bool = False (default keeps today’s single-stderr behavior), or
stream=... plus an optional error_stream=... / threshold
Default should remain current behavior so existing callers are not surprised.
Summary
rfl.log.setup_loggercurrently attaches a singlelogging.StreamHandler()with no stream argument, so all accepted records go to stderr.For container/CLI usage it is useful to follow the common split:
That keeps operational noise off stderr (so tools that treat stderr as “errors only” stay quiet) while preserving WARNING/ERROR/CRITICAL on stderr.
Current behavior
In
setup_logger, after resolving the root level and flag filter, RFL does roughly:There is no API to choose streams or to split by level.
Proposed behavior
When enabled (exact API TBD),
setup_loggerwould configure two stream handlers sharing the existing formatter andlog_flags/debug_flagsfilter:sys.stdoutlevelno < logging.WARNING(and still gated by the configured level)sys.stderrlevelno >= logging.WARNING(handler level at least WARNING)Configured
level/debugsemantics and component flag filtering should stay unchanged; only the destination stream would change.Suggested API
Backward-compatible options, e.g.:
split_streams: bool = False(default keeps today’s single-stderr behavior), orstream=...plus an optionalerror_stream=.../ thresholdDefault should remain current behavior so existing callers are not surprised.