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:
parent
27e50768a8
commit
8cbec148da
@ -22,12 +22,12 @@
|
|||||||
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
|
* along with CNIRevelator. If not, see <https:*www.gnu.org/licenses/>. *
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
"""
|
"""
|
||||||
## The logging class
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import globs
|
import globs
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
## The logging class
|
||||||
class NewLoggingSystem:
|
class NewLoggingSystem:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -44,7 +44,7 @@ class NewLoggingSystem:
|
|||||||
logger.setLevel(logging.INFO) # To make sure we can have a debug channel
|
logger.setLevel(logging.INFO) # To make sure we can have a debug channel
|
||||||
|
|
||||||
# Create channels
|
# 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)
|
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')
|
info_handler = logging.FileHandler((globs.CNIRFolder + '\\launcher.log'), mode='w', encoding='utf-8')
|
||||||
|
|
||||||
@ -59,3 +59,6 @@ class NewLoggingSystem:
|
|||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.printerr = logger.error
|
self.printerr = logger.error
|
||||||
self.printdbg = logger.info
|
self.printdbg = logger.info
|
||||||
|
|
||||||
|
## Global Handler
|
||||||
|
logCur = NewLoggingSystem()
|
||||||
|
Loading…
Reference in New Issue
Block a user