mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
This commit is contained in:
@@ -19,7 +19,6 @@ import random
|
||||
import string
|
||||
import ipaddress
|
||||
|
||||
|
||||
import conf
|
||||
from const import *
|
||||
from logger import mylog, logResult
|
||||
@@ -336,13 +335,7 @@ def get_setting_value(key):
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Convert the setting value to the corresponding python type
|
||||
import json
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
import json
|
||||
import base64
|
||||
import hashlib
|
||||
|
||||
def setting_value_to_python_type(set_type, set_value):
|
||||
value = '----not processed----'
|
||||
|
||||
@@ -22,7 +22,16 @@ debugLevels = [
|
||||
('none', 0), ('minimal', 1), ('verbose', 2), ('debug', 3), ('trace', 4)
|
||||
]
|
||||
|
||||
currentLevel = 0
|
||||
# use the LOG_LEVEL from the config, may be overridden
|
||||
currentLevel = conf.LOG_LEVEL
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
class Logger:
|
||||
def __init__(self, LOG_LEVEL='verbose'):
|
||||
global currentLevel
|
||||
|
||||
currentLevel = LOG_LEVEL
|
||||
|
||||
|
||||
def mylog(requestedDebugLevel, n):
|
||||
setLvl = 0
|
||||
@@ -30,7 +39,7 @@ def mylog(requestedDebugLevel, n):
|
||||
|
||||
# Get debug urgency/relative weight
|
||||
for lvl in debugLevels:
|
||||
if conf.LOG_LEVEL == lvl[0]:
|
||||
if currentLevel == lvl[0]:
|
||||
setLvl = lvl[1]
|
||||
if requestedDebugLevel == lvl[0]:
|
||||
reqLvl = lvl[1]
|
||||
|
||||
Reference in New Issue
Block a user