Python logging formatting by level

Viewed 504

I'm using python's logging library, but I want the debug logs to have a different format than the warning and error logs. Is this possible?

ETA: I want warnings and errors to appear as:

%(levelname)s: %(message)s

but debug statements to appear as

DEBUG: (only Brian cares about this) : %(message)s

all other questions I've seen have been to change the format, but that changes for EVERYTHING.

1 Answers
Related