[Python] Kivy - filtering log levels in stream output

Discussão em 'Python' iniciado por Stack, Maio 27, 2025.

  1. Stack

    Stack Membro Participativo

    I'm having trouble configuring my logger.

    My app uses libraries which use the standard python logging library. I cannot configure the Kivy Logger object to filter different log levels or modules. Consider the following snippet:

    import logging

    from kivy.logger import Logger, LOG_LEVELS

    if __name__ == '__main__':
    Logger.setLevel(LOG_LEVELS["info"])

    logger = logging.getLogger('poopoo')
    Logger.addFilter(logging.Filter('poopoo'))

    for i in range(5):
    Logger.debug('kivy')
    logger.debug('pylogger')


    Logger.debug is successfully filtered, but logger.debug is not.

    What is the issue here? I have tried setting Kivy log mode to MIXED or PYTHON without avail.

    Continue reading...

Compartilhe esta Página