Pending changes update
This commit is contained in:
17
main.py
17
main.py
@@ -1,12 +1,23 @@
|
||||
import json
|
||||
import threading
|
||||
import logging
|
||||
from logging.handlers import RotatingFileHandler
|
||||
from item_monitor import ItemMonitor
|
||||
from worker import Worker
|
||||
|
||||
logging.basicConfig(level=logging.INFO,
|
||||
format='%(asctime)s - %(levelname)s - %(message)s',
|
||||
handlers=[logging.FileHandler('main_log.txt'), logging.StreamHandler()])
|
||||
# Configure the console logger
|
||||
console_handler = logging.StreamHandler()
|
||||
console_handler.setLevel(logging.INFO)
|
||||
console_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s'))
|
||||
|
||||
# Configure the file logger
|
||||
file_handler = RotatingFileHandler('monitor.log', maxBytes=10e6)
|
||||
file_handler.setLevel(logging.DEBUG)
|
||||
file_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s'))
|
||||
|
||||
# Configure the root logger with both handlers
|
||||
logging.basicConfig(level=logging.NOTSET,
|
||||
handlers=[console_handler, file_handler])
|
||||
|
||||
def parse_items_to_monitor():
|
||||
with open("args.json") as f:
|
||||
|
||||
Reference in New Issue
Block a user