Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
be840c2a
Commit
be840c2a
authored
3 months ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Formatting in setup_logging.py
parent
931720bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1059
[webservice] Intoduce Global Logger for xfel-calibrate
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xfel_calibrate/setup_logging.py
+6
-4
6 additions, 4 deletions
src/xfel_calibrate/setup_logging.py
with
6 additions
and
4 deletions
src/xfel_calibrate/setup_logging.py
+
6
−
4
View file @
be840c2a
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`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment