From 6dfad8b365be11c077d34ef68c0771288768bd5b Mon Sep 17 00:00:00 2001 From: walesch-yan Date: Thu, 24 Oct 2024 16:03:44 +0200 Subject: [PATCH] removing system log --- mxcubeweb/logging_handler.py | 11 +-- ui/src/actions/logger.js | 4 - ui/src/components/App.jsx | 5 - ui/src/components/MXNavbar/MXNavbar.jsx | 3 - ui/src/components/Notify/UserMessage.jsx | 5 - ui/src/containers/LoggerContainer.jsx | 104 --------------------- ui/src/containers/SampleQueueContainer.jsx | 5 +- ui/src/reducers/logger.js | 4 - 8 files changed, 2 insertions(+), 139 deletions(-) delete mode 100644 ui/src/containers/LoggerContainer.jsx diff --git a/mxcubeweb/logging_handler.py b/mxcubeweb/logging_handler.py index e96ce72fd..029bada50 100644 --- a/mxcubeweb/logging_handler.py +++ b/mxcubeweb/logging_handler.py @@ -1,5 +1,4 @@ import logging -import traceback class MX3LoggingHandler(logging.handlers.BufferingHandler): @@ -13,10 +12,6 @@ def connect(): pass def _record_to_json(self, record): - if record.exc_info: - stack_trace = "".join(traceback.format_exception(*record.exc_info)) - else: - stack_trace = "" try: record.asctime except AttributeError: @@ -26,14 +21,10 @@ def _record_to_json(self, record): "message": record.getMessage(), "severity": record.levelname, "timestamp": record.asctime, - "logger": record.name, - "stack_trace": stack_trace, } def emit(self, record): - if record.name != "geventwebsocket.handler": + if record.name == "user_level_log": record_dict = self._record_to_json(record) super().emit(record_dict) self.server.emit("log_record", record_dict, namespace="/logging") - else: - super().emit(record) diff --git a/ui/src/actions/logger.js b/ui/src/actions/logger.js index 9dfb80baa..df425e118 100644 --- a/ui/src/actions/logger.js +++ b/ui/src/actions/logger.js @@ -1,7 +1,3 @@ export function addLogRecord(data) { return { type: 'ADD_LOG_RECORD', data }; } - -export function setLogPage(page) { - return { type: 'SET_PAGE_LOGGING', page }; -} diff --git a/ui/src/components/App.jsx b/ui/src/components/App.jsx index 12fc7b8d8..95b189c88 100644 --- a/ui/src/components/App.jsx +++ b/ui/src/components/App.jsx @@ -10,7 +10,6 @@ import LoginContainer from '../containers/LoginContainer'; import SampleViewContainer from '../containers/SampleViewContainer'; import SampleListViewContainer from '../containers/SampleListViewContainer'; import EquipmentContainer from '../containers/EquipmentContainer'; -import LoggerContainer from '../containers/LoggerContainer'; import RemoteAccessContainer from '../containers/RemoteAccessContainer'; import HelpContainer from '../containers/HelpContainer'; import Main from './Main'; @@ -48,10 +47,6 @@ const router = createBrowserRouter([ path: 'equipment', element: , }, - { - path: 'logging', - element: , - }, { path: 'remoteaccess', element: , diff --git a/ui/src/components/MXNavbar/MXNavbar.jsx b/ui/src/components/MXNavbar/MXNavbar.jsx index 95f9e6cc5..90b6a907d 100644 --- a/ui/src/components/MXNavbar/MXNavbar.jsx +++ b/ui/src/components/MXNavbar/MXNavbar.jsx @@ -63,9 +63,6 @@ function MXNavbar() { Equipment - - System log -