28 lines
634 B
Python
28 lines
634 B
Python
# dmapp/dmcore/config.py
|
||
import logging
|
||
|
||
from pymongo import MongoClient
|
||
|
||
# Logging configuration
|
||
logging.basicConfig(
|
||
level=logging.INFO,
|
||
format="%(asctime)s %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s",
|
||
datefmt="%Y-%m-%d %H:%M:%S",
|
||
)
|
||
# 2) Get your module’s logger and bump it to DEBUG
|
||
logger = logging.getLogger(__name__)
|
||
logger.setLevel(logging.DEBUG)
|
||
|
||
# 3) Silence pymongo (and any other libs you find chatty)
|
||
logging.getLogger("pymongo").setLevel(logging.WARNING)
|
||
|
||
|
||
# MongoDB configuration
|
||
client = MongoClient()
|
||
db = client.deskmeter
|
||
|
||
# Collections
|
||
switches = db.switch
|
||
states = db.state
|
||
tasks = db.task
|