From bf594a5bdf9fd4354c9c5c564c7a8649a97d6343 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Wed, 19 Jun 2024 15:33:11 +1000 Subject: [PATCH 1/3] added name to logger output --- xnat_ingest/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xnat_ingest/utils.py b/xnat_ingest/utils.py index efc903e..017dcbb 100644 --- a/xnat_ingest/utils.py +++ b/xnat_ingest/utils.py @@ -187,7 +187,7 @@ def set_logger_handling( console_hdle = logging.StreamHandler(sys.stdout) console_hdle.setLevel(getattr(logging, log_level.upper())) console_hdle.setFormatter( - logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") + logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") ) for logr in loggers: logr.addHandler(console_hdle) From aa0aecd19c6d17ec21b8b4b09dc2fe6bfd148318 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Wed, 19 Jun 2024 15:33:48 +1000 Subject: [PATCH 2/3] added name to log file logging --- xnat_ingest/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xnat_ingest/utils.py b/xnat_ingest/utils.py index 017dcbb..8430179 100644 --- a/xnat_ingest/utils.py +++ b/xnat_ingest/utils.py @@ -179,7 +179,7 @@ def set_logger_handling( if log_file.loglevel: log_file_hdle.setLevel(getattr(logging, log_file.loglevel.upper())) log_file_hdle.setFormatter( - logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") + logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") ) for logr in loggers: logr.addHandler(log_file_hdle) From d2ab8e58c23a0f1fe3144429238410a6f451a7b0 Mon Sep 17 00:00:00 2001 From: Tom Close Date: Thu, 20 Jun 2024 10:44:00 +1000 Subject: [PATCH 3/3] added more debug log messages --- xnat_ingest/cli/upload.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xnat_ingest/cli/upload.py b/xnat_ingest/cli/upload.py index 19e566a..4f7afa2 100644 --- a/xnat_ingest/cli/upload.py +++ b/xnat_ingest/cli/upload.py @@ -433,14 +433,23 @@ def iter_staged_sessions(): SessionClass, ScanClass, ) + logger.debug("Creating scan %s in %s", scan_id, session_path) xscan = ScanClass(id=scan_id, type=scan_type, parent=xsession) + logger.debug( + "Creating resource %s in %s in %s", + resource_name, + scan_id, + session_path, + ) xresource = xscan.create_resource(resource_name) if isinstance(scan, File): for fspath in scan.fspaths: xresource.upload(str(fspath), fspath.name) else: xresource.upload_dir(scan.parent) + logger.debug("retrieving checksums for %s", xresource) remote_checksums = get_checksums(xresource) + logger.debug("calculating checksums for %s", xresource) calc_checksums = calculate_checksums(scan) if remote_checksums != calc_checksums: mismatching = [