Updated logging endpoint and levels
This commit is contained in:
parent
62834b7280
commit
f1ef7e7b78
|
@ -7,7 +7,7 @@ import threading
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from core.utils import Logger
|
from core.utils import Logger
|
||||||
from core.utils import MessageHandler # Get simple message processor
|
from core.utils import MessageHandler
|
||||||
|
|
||||||
|
|
||||||
class BuiltinsException(Exception):
|
class BuiltinsException(Exception):
|
||||||
|
@ -32,5 +32,5 @@ builtins.app_name = ':::APP TITLE:::'
|
||||||
builtins.threaded = threaded_wrapper
|
builtins.threaded = threaded_wrapper
|
||||||
builtins.daemon_threaded = daemon_threaded_wrapper
|
builtins.daemon_threaded = daemon_threaded_wrapper
|
||||||
builtins.ROOT_FILE_PTH = os.path.dirname(os.path.realpath(__file__))
|
builtins.ROOT_FILE_PTH = os.path.dirname(os.path.realpath(__file__))
|
||||||
builtins.logger = Logger(f"{ROOT_FILE_PTH}/../logs", _ch_log_lvl=10, _fh_log_lvl=20).get_logger()
|
builtins.logger = Logger(f"{ROOT_FILE_PTH}/../logs", _ch_log_lvl=10, _fh_log_lvl=10).get_logger()
|
||||||
builtins.json_message = MessageHandler()
|
builtins.json_message = MessageHandler()
|
||||||
|
|
|
@ -21,12 +21,12 @@ def home():
|
||||||
title='Error!',
|
title='Error!',
|
||||||
message='Must use GET request type...')
|
message='Must use GET request type...')
|
||||||
|
|
||||||
# NOTE: Yeah, not exactly 'logged' but mostly used with the terminal anyway.
|
# NOTE: Normaly should sanitize logs or remove PII, etc.
|
||||||
@app.route('/log-client-exception', methods=['GET', 'POST'])
|
@app.route('/log-client-exception', methods=['GET', 'POST'])
|
||||||
def ui_failure_exception_tracker():
|
def ui_failure_exception_tracker():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
DATA = str(request.values['exception_data']).strip()
|
DATA = str(request.values['exception_data']).strip()
|
||||||
print(f"\n\n{DATA}")
|
logger.debug(DATA)
|
||||||
return json_message.create("success", "UI Exception logged...")
|
return json_message.create("success", "UI Exception logged...")
|
||||||
|
|
||||||
return json_message.create("danger", "Must use POST request type...")
|
return json_message.create("danger", "Must use POST request type...")
|
||||||
|
|
Loading…
Reference in New Issue