Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check a dict passed to ProcessorFormatter actually came from structlog.
ProcessorFormatter assumes certain attributes are attached by wrap_for_formatter but originally only tested if it was receiving a dictionary as the log message. This breaks if any libraries you use happen to pass dictionaries as log messages expecting them to print using default string formatting. Fortunately since the behavior of the LogRecord is different between the two paths, we can resolve this by testing for the relevent attrs before choosing.
- Loading branch information