Swind / pure-python-adb

This is pure-python implementation of the ADB client.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loggin module interferences

claer opened this issue · comments

commented

Hi,

By default, your module is modifying default logging output. Is it possible to document the behaviour and/or to disable logging capabilities in your module?

Sample code:

#!/usr/bin/env python3
import logging
from colorlog import ColoredFormatter
from adb.client import Client as AdbClient

# create logger
mylogger = logging.getLogger(__name__)
mylogger.setLevel(logging.DEBUG)

# create console handler and set level to INFO
ch=logging.StreamHandler()
ch.setLevel(logging.DEBUG)

# create formatter
formatter = ColoredFormatter(" %(log_color)s%(levelname)-8s%(reset)s | %(log_color)s%(message)s%(reset)s")

ch.setFormatter(formatter)
mylogger.addHandler(ch)

mylogger.debug('blu')
mylogger.info('blu')
mylogger.warning('blu')
mylogger.error('blu')
commented

Hi claer

You are right, I should not call the logging.basickConfig() in the module.
I will remove this and document how to enable/disable the logger.