fix: merge conflict

This commit is contained in:
Korzhavin Ivan 2025-10-20 01:00:55 +02:00
commit f8a8b581f4
3 changed files with 13 additions and 5 deletions

16
main.py
View file

@ -14,6 +14,7 @@ from typing import List, Dict, Optional, Union, Any
import nest_asyncio import nest_asyncio
from dotenv import load_dotenv from dotenv import load_dotenv
from mcp.server.fastmcp import FastMCP from mcp.server.fastmcp import FastMCP
from pythonjsonlogger import jsonlogger
from telethon import TelegramClient, functions, utils from telethon import TelegramClient, functions, utils
from telethon.sessions import StringSession from telethon.sessions import StringSession
from telethon.tl.types import ( from telethon.tl.types import (
@ -86,12 +87,17 @@ try:
file_handler = logging.FileHandler(log_file_path, mode="a") # Append mode file_handler = logging.FileHandler(log_file_path, mode="a") # Append mode
file_handler.setLevel(logging.ERROR) file_handler.setLevel(logging.ERROR)
# Create formatter and add to handlers # Create formatters
formatter = logging.Formatter( # Console formatter remains in the old format
"%(asctime)s [%(levelname)s] %(name)s - %(message)s - %(filename)s:%(lineno)d" console_formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(name)s - %(message)s")
console_handler.setFormatter(console_formatter)
# File formatter is now JSON
json_formatter = jsonlogger.JsonFormatter(
"%(asctime)s %(name)s %(levelname)s %(message)s",
datefmt="%Y-%m-%dT%H:%M:%S%z",
) )
console_handler.setFormatter(formatter) file_handler.setFormatter(json_formatter)
file_handler.setFormatter(formatter)
# Add handlers to logger # Add handlers to logger
logger.addHandler(console_handler) logger.addHandler(console_handler)

View file

@ -29,6 +29,7 @@ dependencies = [
"mcp[cli]>=1.4.1", "mcp[cli]>=1.4.1",
"nest-asyncio>=1.6.0", "nest-asyncio>=1.6.0",
"python-dotenv>=1.1.0", "python-dotenv>=1.1.0",
"python-json-logger>=3.3.0",
"telethon>=1.39.0" "telethon>=1.39.0"
] ]

View file

@ -3,4 +3,5 @@ httpx>=0.28.1
mcp[cli]>=1.4.1 mcp[cli]>=1.4.1
nest-asyncio>=1.6.0 nest-asyncio>=1.6.0
python-dotenv>=1.1.0 python-dotenv>=1.1.0
python-json-logger>=3.3.0
telethon>=1.39.0 telethon>=1.39.0