User logger child for each module
This commit is contained in:
parent
d74f29fefb
commit
cd5484ef88
8 changed files with 15 additions and 0 deletions
|
@ -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):
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Reference in a new issue