I looked through the tutorials for the python logging class here and didnt see anything that would let me make multiple logs of different levels for the same output. In the
Create multiple Handlers, each for one output file (INFO.log, DEBUG.log etc.).
Add a filter to each handler that only allows the specific level.
For example:
import logging
# Set up loggers and handlers.
# ...
class LevelFilter(logging.Filter):
def __init__(self, level):
self.level = level
def filter(self, record):
return record.levelno == self.level
debugLogFileHandler.addFilter(LevelFilter(logging.DEBUG))
infoLogFileHandler.addFilter(LevelFilter(logging.INFO))