Skip to content

Commit

Permalink
Modify _log_input_summary function
Browse files Browse the repository at this point in the history
Fixes Project-MONAI#7513

Signed-off-by: Ted.Lai <[email protected]>
  • Loading branch information
hyacinth97223 committed May 27, 2024
1 parent 94ab632 commit bf9db2c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions monai/bundle/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# limitations under the License.

from __future__ import annotations
from io import StringIO

import ast
import json
Expand Down Expand Up @@ -116,10 +117,20 @@ def _pop_args(src: dict, *args: Any, **kwargs: Any) -> tuple:


def _log_input_summary(tag: str, args: dict) -> None:
logger.info(f"--- input summary of monai.bundle.scripts.{tag} ---")
<<<<<<< HEAD
log_buffer = StringIO()
log_buffer.write(f"--- input summary of monai.bundle.scripts.{tag} ---\n")
for name, val in args.items():
logger.info(f"> {name}: {pprint_edges(val, PPRINT_CONFIG_N)}")
logger.info("---\n\n")
log_buffer.write(f"> {name}: {pprint_edges(val, PPRINT_CONFIG_N)}\n")
log_buffer.write("---\n\n")
=======
log_buffer = StringIO()
log_buffer.write(f"--- input summary of monai.bundle.scripts.{tag} ---\n")
for name, val in args.items():
log_buffer.write(f"> {name}: {pprint_edges(val, PPRINT_CONFIG_N)}\n")
log_buffer.write("---\n\n")
>>>>>>> 28f5ebe7e3a0487b9d78123a80d565f1fa26615a
logger.info(log_buffer.getvalue()) # output all content in buffer


def _get_var_names(expr: str) -> list[str]:
Expand Down

0 comments on commit bf9db2c

Please sign in to comment.