added logging config for init monitor
This commit is contained in:
1 parent
4ac8692539
commit
c13e0d3c77
6 files changed
+27
-23
No files matched your search
+18
-11
@@ -6,36 +6,43 @@ from typing import Awaitable, Callable, Iterable
|
||||
import aiohttp
|
||||
from aioproxies import AioProxies
|
||||
from curl_cffi.requests import AsyncSession
|
||||
from log_setup import setup_logging
|
||||
from motor.motor_asyncio import AsyncIOMotorCollection
|
||||
|
||||
from aioproxies import AioProxies
|
||||
from monitor_utils.constants import (
|
||||
EXPECTED_TASK_ERRORS,
|
||||
FLAG_WEBHOOK_MAP,
|
||||
BUCKET_WEBHOOK_MAP,
|
||||
)
|
||||
from monitor_utils.config import (
|
||||
DevelopmentMode,
|
||||
get_config,
|
||||
is_production,
|
||||
set_logger_levels,
|
||||
DevelopmentMode,
|
||||
)
|
||||
from monitor_utils.constants import (
|
||||
BUCKET_WEBHOOK_MAP,
|
||||
EXPECTED_TASK_ERRORS,
|
||||
FLAG_WEBHOOK_MAP,
|
||||
LOGGING_LEVEL,
|
||||
)
|
||||
from monitor_utils.database import get_collection
|
||||
from monitor_utils.models import (
|
||||
AvailabilityInfo,
|
||||
PricingInfo,
|
||||
Product,
|
||||
ProductMetadata,
|
||||
ProductTiming,
|
||||
PricingInfo,
|
||||
AvailabilityInfo,
|
||||
)
|
||||
from monitor_utils.sessions import get_base_session, get_tls_session
|
||||
from monitor_utils.database import get_collection
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def init_monitor(
|
||||
monitor_name: str, development_mode: DevelopmentMode, proxy_path: str
|
||||
monitor_name: str,
|
||||
development_mode: DevelopmentMode,
|
||||
proxy_path: str,
|
||||
logging_level=LOGGING_LEVEL,
|
||||
) -> tuple[list[str], AsyncIOMotorCollection, AioProxies]:
|
||||
setup_logging(
|
||||
name="logs/latest.log", history_name="apple", level=logging_level, output="json"
|
||||
)
|
||||
set_logger_levels()
|
||||
category_names, _, collection = setup_config(
|
||||
monitor_name=monitor_name, development_mode=development_mode
|
||||
|
||||
Reference in new issue
Block a user