From 9bb0a8d7803bf454843a6949652bb2fe3b80789d Mon Sep 17 00:00:00 2001 From: Julien Lerat Date: Wed, 14 Feb 2024 15:18:55 +1100 Subject: [PATCH] fix: polished log commit --- hydrodiy/io/iutils.py | 4 ++-- hydrodiy/io/tests/test_hyio_iutils.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hydrodiy/io/iutils.py b/hydrodiy/io/iutils.py index 4b6af832..9b6f8edc 100644 --- a/hydrodiy/io/iutils.py +++ b/hydrodiy/io/iutils.py @@ -156,8 +156,7 @@ def log_dict(self, tolog, name="", level="info"): """ Add log entry for dictionnary (e.g. created from argparse using vars)""" assert level in ["info", "warning", "critical", "error"] logfun = getattr(self, level) - logfun("") - sep = self.get_separator("#", 10) + sep = self.get_separator("+", 20) logfun(sep) if name!="": logfun(f"{name}:") @@ -165,6 +164,7 @@ def log_dict(self, tolog, name="", level="info"): logfun(" "*4+f"{k} = {v}") logfun(sep) + logfun("") diff --git a/hydrodiy/io/tests/test_hyio_iutils.py b/hydrodiy/io/tests/test_hyio_iutils.py index 4395b244..2ef81860 100644 --- a/hydrodiy/io/tests/test_hyio_iutils.py +++ b/hydrodiy/io/tests/test_hyio_iutils.py @@ -137,8 +137,8 @@ def test_get_logger(): ck = ck & txt[5].strip().endswith("ERROR | error") ck = ck & txt[6].strip().endswith("CRITICAL | critical") ck = ck & txt[7].strip().endswith("WARNING | warning") - ck = ck & txt[10].strip().endswith("WARNING | test:") - ck = ck & txt[11].strip().endswith("WARNING | a = 1") + ck = ck & txt[9].strip().endswith("WARNING | test:") + ck = ck & txt[10].strip().endswith("WARNING | a = 1") assert ck # Test logging with different format