-
-
Notifications
You must be signed in to change notification settings - Fork 251
Closed
Description
The following code:
import structlog
structlog.configure(
processors=[
structlog.processors.TimeStamper(fmt="iso", key="ts"),
structlog.stdlib.add_log_level,
structlog.dev.ConsoleRenderer(),
],
logger_factory=structlog.PrintLoggerFactory(),
)
logger = structlog.get_logger()
logger.info("Testing!")
Produces the following logs. Note that ts
is at the end, instead of the beginning, where I would've expected.
[info ] Testing! ts=2023-08-18T21:53:56.587146Z
If I remove the key
parameter from the TimeStamper (structlog.processors.TimeStamper(fmt="iso")
), the timestamp properly moves to the beginning, as I would expect:
2023-08-18T21:54:50.018921Z [info ] Testing!
Considering that the key
parameter is built-into TimeStamper
, could ConsoleRenderer
be updated to properly render the timestamp where it's supposed to be if you change the key
?
I'm also not completely convinced I'm not just doing something wrong, so any help would be appreciated. Thanks!
Metadata
Metadata
Assignees
Labels
No labels