1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 04:19:55 +01:00
Clementine-audio-player-Mac.../data/pythonlibs/clementinelogging.py

15 lines
348 B
Python

import clementine
import logging
class ClementineLogHandler(logging.Handler):
def emit(self, record):
clementine.pythonengine.HandleLogRecord(
record.levelno, record.name, record.lineno, record.getMessage())
def setup_logging():
root = logging.getLogger()
root.addHandler(ClementineLogHandler())
root.setLevel(logging.NOTSET)