Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mHM Tools
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mhm
mHM Tools
Commits
fea65587
Commit
fea65587
authored
1 week ago
by
Valentin Simon Lüdke
Browse files
Options
Downloads
Patches
Plain Diff
Enable definition of log level for log_arguments header
parent
f6c7a532
No related branches found
Branches containing commit
No related tags found
2 merge requests
!16
Generate classical mhm setups from classical setup
,
!8
Draft: Resolve "Pre-Proc: incorporate tools for creating global setups"
Pipeline
#276725
failed with stages
Stage: test
Stage: build
in 2 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mhm_tools/_cli/_grdc_validation.py
+1
-2
1 addition, 2 deletions
src/mhm_tools/_cli/_grdc_validation.py
src/mhm_tools/common/logger.py
+5
-2
5 additions, 2 deletions
src/mhm_tools/common/logger.py
with
6 additions
and
4 deletions
src/mhm_tools/_cli/_grdc_validation.py
+
1
−
2
View file @
fea65587
...
...
@@ -2,8 +2,7 @@
from
mhm_tools.common.cli_utils
import
get_coords
from
mhm_tools.post.GRDC_validation
import
evaludate_grdc_data
import
logging
logger
=
logging
.
getLogger
(
__name__
)
def
add_args
(
parser
):
required_args
=
parser
.
add_argument_group
(
"
required arguments
"
)
...
...
This diff is collapsed.
Click to expand it.
src/mhm_tools/common/logger.py
+
5
−
2
View file @
fea65587
...
...
@@ -112,7 +112,7 @@ def get_log_level(level=None, count_verbose=0, count_quiet=0):
return
level
,
error_msg
def
log_arguments
():
def
log_arguments
(
log_level
=
'
Debug
'
):
"""
Log all non-None arguments passed to a function.
"""
def
decorator
(
func
):
...
...
@@ -132,7 +132,10 @@ def log_arguments():
msg
=
f
"
Function
'
{
func
.
__name__
}
'
called with the following arguments:
\n
"
for
arg
,
value
in
non_none_args
.
items
():
msg
+=
f
"
{
arg
}
:
{
value
}
\n
"
logger
.
debug
(
msg
)
if
log_level
.
upper
()
==
"
INFO
"
:
logger
.
info
(
msg
)
else
:
logger
.
debug
(
msg
)
# Call the original function
try
:
return
func
(
*
args
,
**
kwargs
)
...
...
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