Skip to content

Commit

Permalink
Update logging setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Clon1998 committed Jul 3, 2024
1 parent ce4b730 commit 042a5b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mobileraker/util/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ def doRollover(self):
# Logging based on Arksine's logging setup
def setup_logging(log_file, software_version):
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)

coloredlogs.install(
logger=root_logger, fmt=f'%(asctime)s %(name)s %(levelname)s %(message)s')
logger=root_logger, fmt=f'%(asctime)s %(name)s %(levelname)s %(message)s', level=logging.INFO)

# Check if provided log_file is a file or a directory
if os.path.isdir(log_file):
log_file = os.path.join(log_file, "mobileraker.log")

print(f"Logging to file: {os.path.normpath(log_file)}")
root_logger.info(f"Logging to file: {os.path.normpath(log_file)}")
try:
fh = MobilerakerCompanionLoggingHandler(
software_version, log_file, maxBytes=4194304, backupCount=3)
Expand Down

0 comments on commit 042a5b9

Please sign in to comment.