mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Log formatting
This commit is contained in:
parent
db237412e2
commit
fe6e3ba1a6
6 changed files with 11 additions and 2 deletions
2
bots.py
2
bots.py
|
@ -8,10 +8,10 @@ import logging
|
|||
import coloredlogs
|
||||
import os
|
||||
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
|
||||
logging.getLogger().disabled = True
|
||||
logger = logging.getLogger(__name__)
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
coloredlogs.install(level="DEBUG", logger=logger)
|
||||
|
||||
discord_telegram_pipe = multiprocessing.Pipe()
|
||||
|
|
7
db.py
7
db.py
|
@ -1,6 +1,7 @@
|
|||
import datetime
|
||||
import logging
|
||||
|
||||
import os
|
||||
import coloredlogs
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker, relationship, joinedload
|
||||
from sqlalchemy.ext.hybrid import hybrid_property
|
||||
|
@ -22,6 +23,10 @@ engine = create_engine(config["Database"]["database_uri"])
|
|||
Base = declarative_base(bind=engine)
|
||||
Session = sessionmaker(bind=engine)
|
||||
|
||||
logging.getLogger().disabled = True
|
||||
logger = logging.getLogger(__name__)
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
coloredlogs.install(level="DEBUG", logger=logger)
|
||||
|
||||
class Royal(Base):
|
||||
__tablename__ = "royals"
|
||||
|
|
|
@ -22,6 +22,7 @@ import coloredlogs
|
|||
|
||||
logging.getLogger().disabled = True
|
||||
logger = logging.getLogger(__name__)
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
coloredlogs.install(level="DEBUG", logger=logger)
|
||||
|
||||
# Queue emojis
|
||||
|
|
|
@ -15,6 +15,7 @@ config.read("config.ini")
|
|||
|
||||
logging.getLogger().disabled = True
|
||||
logger = logging.getLogger(__name__)
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
coloredlogs.install(level="DEBUG", logger=logger)
|
||||
|
||||
sentry = raven.Client(config["Sentry"]["token"],
|
||||
|
|
|
@ -11,6 +11,7 @@ import coloredlogs
|
|||
|
||||
logging.getLogger().disabled = True
|
||||
logger = logging.getLogger(__name__)
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
coloredlogs.install(level="DEBUG", logger=logger)
|
||||
|
||||
# Init the config reader
|
||||
|
|
|
@ -26,6 +26,7 @@ except Exception:
|
|||
|
||||
logging.getLogger().disabled = True
|
||||
logger = logging.getLogger(__name__)
|
||||
os.environ["COLOREDLOGS_LOG_FORMAT"] = "%(asctime)s %(levelname)s %(name)s %(message)s"
|
||||
coloredlogs.install(level="DEBUG", logger=logger)
|
||||
|
||||
# Init the config reader
|
||||
|
|
Loading…
Reference in a new issue