# # All rights reserved. __all__ = ['Filtr', 'clear_db'] import asyncio from typing import List, Tuple from pyrogram.client.handlers.handler import Handler from userge import logging, Config from .. import client as _client, get_collection _DISABLED_FILTERS = get_collection("DISABLED_FILTERS") _UNLOADED_FILTERS = get_collection("UNLOADED_FILTERS") _LOG = logging.getLogger(__name__) _LOG_STR = "<<<! [[[[[ %s ]]]]] !>>>" _DISABLED: List[str] = [] _UNLOADED: List[str] = [] def _init(name: str) -> Tuple[bool, bool]: name = name.lstrip(Config.CMD_TRIGGER) enabled = True loaded = True if name in _DISABLED: enabled = False if name in _UNLOADED: loaded = False return enabled, loaded
def getLogger(name: str = '') -> logging.Logger: # pylint: disable=invalid-name """ This returns new logger object """ if not name: name = inspect.currentframe().f_back.f_globals['__name__'] _LOG.debug(_LOG_STR, f"Creating Logger => {name}") return logging.getLogger(name)
def getLogger(name: str) -> logging.Logger: # pylint: disable=invalid-name """ This returns new logger object """ _LOG.debug(_LOG_STR, f"Creating Logger => {name}") return logging.getLogger(name)
def getLogger(name: str) -> logging.Logger: """ This returns new logger object """ _LOG.debug(_LOG_STR, f"Creating Logger => {name}") return logging.getLogger(name)
def getLogger(name: str = '') -> logging.Logger: # pylint: disable=invalid-name """ This returns new logger object """ if not name: name = inspect.currentframe().f_back.f_globals['__name__'] return logging.getLogger(name)