Skip to content
Snippets Groups Projects
Commit be840c2a authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Formatting in setup_logging.py

parent 931720bc
No related branches found
No related tags found
1 merge request!1059[webservice] Intoduce Global Logger for xfel-calibrate
import json
import os import os
import sys import sys
import json
import warnings import warnings
import IPython
from datetime import datetime from datetime import datetime
from typing import Type, Any from typing import Any, Type
from cal_tools.warnings import CalibrationWarning import IPython
from cal_tools.warnings import CalibrationWarning
JOB_ID = os.getenv('SLURM_JOB_ID', 'local') JOB_ID = os.getenv('SLURM_JOB_ID', 'local')
...@@ -44,8 +44,10 @@ def log_error( ...@@ -44,8 +44,10 @@ def log_error(
except Exception as e: except Exception as e:
sys.stdout.write(f"Logging failed: {e}\n") sys.stdout.write(f"Logging failed: {e}\n")
original_showwarning = warnings.showwarning original_showwarning = warnings.showwarning
def handle_warning( def handle_warning(
message: Warning, category: Type[Warning], message: Warning, category: Type[Warning],
# these are needed for `warnings.showwarning` # these are needed for `warnings.showwarning`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment