Skip to content

Commit

Permalink
fix call of logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki committed Aug 13, 2024
1 parent 30574f5 commit 21169e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package/PartSeg/_roi_analysis/export_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def sleep_with_rate(response: requests.Response):
reset = int(response.headers["X-RateLimit-Reset"])
sleep_time = reset - time.time()
if sleep_time > 0:
logging.info("Sleeping for {sleep_time} seconds", extra={"sleep_time": sleep_time})
logging.info("Sleeping for %(sleep_time) seconds", extra={"sleep_time": sleep_time})
time.sleep(sleep_time)


Expand Down
4 changes: 3 additions & 1 deletion package/PartSeg/common_backend/segmentation_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def run(self):
"""the calculation are done here"""
if self.algorithm.image is None:
# assertion for running algorithm without image
logging.error("No image in class {cls_name}", extra={"cls_name": self.algorithm.__class__})
logging.error(
"No image in class %(cls_name)", extra={"cls_name": self.algorithm.__class__}, stack_info=True
)
return
try:
segment_data = self.algorithm.calculation_run_wrap(self.send_info)
Expand Down
2 changes: 1 addition & 1 deletion package/PartSeg/common_gui/advanced_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, parent=None):

def reload_algorithm_action(self):
"""Function for reload plugins and algorithms"""
msg = "Reloading {mod_name}"
msg = "Reloading %(mod_name)"

Check warning on line 70 in package/PartSeg/common_gui/advanced_tabs.py

View check run for this annotation

Codecov / codecov/patch

package/PartSeg/common_gui/advanced_tabs.py#L70

Added line #L70 was not covered by tests
for val in register.reload_module_list:
logging.info(msg, extra={"mod_name": val.__name__})
importlib.reload(val)
Expand Down
2 changes: 1 addition & 1 deletion package/PartSegCore/analysis/load_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def load_project_from_tar(tar_file, file_path):
algorithm_parameters=algorithm_dict,
)
logging.warning(
"This project {proj_ver} is from new version of PartSeg: {version} ",
"This project %(proj_ver) is from new version of PartSeg: %(version)",
extra={"version": version, "proj_ver": project_version_info},
)
return ProjectTuple(
Expand Down

0 comments on commit 21169e5

Please sign in to comment.