1
0
Fork 0

User logger child for each module

This commit is contained in:
Ethanell 2019-12-26 14:21:03 +01:00
parent d74f29fefb
commit cd5484ef88
8 changed files with 15 additions and 0 deletions

View file

@ -15,6 +15,7 @@ from TelegramEDT.base import User
from TelegramEDT.lang import lang from TelegramEDT.lang import lang
re_url = re.compile(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+") re_url = re.compile(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+")
logger = logger.getChild("await_cmd")
def have_await_cmd(msg: types.Message): def have_await_cmd(msg: types.Message):

View file

@ -5,6 +5,8 @@ from TelegramEDT import dbL, dp, key, logger, session, check_id
from TelegramEDT.base import User from TelegramEDT.base import User
from TelegramEDT.lang import lang from TelegramEDT.lang import lang
logger = logger.getChild("basic")
async def start(message: types.Message): async def start(message: types.Message):
check_id(message.from_user) check_id(message.from_user)

View file

@ -8,6 +8,8 @@ from TelegramEDT import dbL, dp, key, logger, posts_cb, session, TIMES, bot, che
from TelegramEDT.base import User from TelegramEDT.base import User
from TelegramEDT.lang import lang from TelegramEDT.lang import lang
logger = logger.getChild("edt")
def calendar(time: str, user_id: int): def calendar(time: str, user_id: int):
with dbL: with dbL:

View file

@ -9,6 +9,8 @@ from TelegramEDT import dbL, dp, key, logger, session, check_id
from TelegramEDT.base import User, KFET_URL from TelegramEDT.base import User, KFET_URL
from TelegramEDT.lang import lang from TelegramEDT.lang import lang
logger = logger.getChild("kfet")
def get_now(): def get_now():
return datetime.datetime.now(datetime.timezone.utc).astimezone(tz=None) return datetime.datetime.now(datetime.timezone.utc).astimezone(tz=None)

View file

@ -4,6 +4,8 @@ from aiogram.types import Message
from TelegramEDT import ADMIN_ID, logger from TelegramEDT import ADMIN_ID, logger
logger = logger.getChild("modules")
def load_module(module: str) -> bool: def load_module(module: str) -> bool:
try: try:

View file

@ -8,6 +8,8 @@ from TelegramEDT import bot, dbL, dp, logger, posts_cb, session, check_id
from TelegramEDT.base import User from TelegramEDT.base import User
from TelegramEDT.lang import lang from TelegramEDT.lang import lang
logger = logger.getChild("notif")
async def notif(): async def notif():
while True: while True:

View file

@ -5,6 +5,8 @@ from TelegramEDT import dbL, dp, key, logger, session, check_id
from TelegramEDT.base import User from TelegramEDT.base import User
from TelegramEDT.lang import lang from TelegramEDT.lang import lang
logger = logger.getChild("tomuss")
async def settomuss(message: types.Message): async def settomuss(message: types.Message):
check_id(message.from_user) check_id(message.from_user)

View file

@ -6,6 +6,8 @@ from aiogram.utils.exceptions import MessageIsTooLong
from TelegramEDT import ADMIN_ID, bot, dbL, dp, key, log_date, logger, session, check_id from TelegramEDT import ADMIN_ID, bot, dbL, dp, key, log_date, logger, session, check_id
from TelegramEDT.base import User from TelegramEDT.base import User
logger = logger.getChild("tools")
async def get_id(message: types.Message): async def get_id(message: types.Message):
check_id(message.from_user) check_id(message.from_user)