1
0
mirror of https://gitlab.os-k.eu/neox/CNIRevelator.git synced 2023-08-25 14:03:10 +02:00

Update logger.py

This commit is contained in:
Adrien Bourmault 2019-07-08 16:27:01 +02:00 committed by GitHub
parent 27e50768a8
commit 8cbec148da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,12 +22,12 @@
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
********************************************************************************
"""
## The logging class
import logging
import globs
import os
## The logging class
class NewLoggingSystem:
def __init__(self):
@ -44,7 +44,7 @@ class NewLoggingSystem:
logger.setLevel(logging.INFO) # To make sure we can have a debug channel
# Create channels
formatter = logging.Formatter('[ %(module)s/%(funcName)s ] %(asctime)s :: %(levelname)s :: %(message)s')
formatter = logging.Formatter("\n[ %(module)s/%(funcName)s ] %(asctime)s :: %(levelname)s :: %(message)s")
error_handler = logging.FileHandler((globs.CNIRFolder + '\\error.log'), mode='w', encoding='utf-8', delay=True)
info_handler = logging.FileHandler((globs.CNIRFolder + '\\launcher.log'), mode='w', encoding='utf-8')
@ -59,3 +59,6 @@ class NewLoggingSystem:
self.logger = logger
self.printerr = logger.error
self.printdbg = logger.info
## Global Handler
logCur = NewLoggingSystem()