Respecting LOG_LEVEL in plugins
Some checks are pending
docker / docker_dev (push) Waiting to run

This commit is contained in:
jokob-sk
2024-12-22 13:18:08 +11:00
parent 96e62468fc
commit 7248e73e03
48 changed files with 168 additions and 57 deletions

View File

@@ -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----'

View File

@@ -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]