Skip to content

Commit 94a4604

Browse files
committed
improve logging of nodes with updated hash
1 parent db479b1 commit 94a4604

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

nipype/pipeline/engine/nodes.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,11 @@ def hash_exists(self, updatehash=False):
308308

309309
# Remove outdated hashfile
310310
if hashfiles and hashfiles[0] != hashfile:
311-
logger.info('[Node] Removing outdated hashfile (%s) and forcing node to rerun',
312-
op.basename(hashfiles[0]))
311+
logger.info('[Node] Outdated hashfile found for "%s", removing and forcing node '
312+
'to rerun', self.fullname)
313313

314-
# In DEBUG, print diff between hashes
315-
log_debug = config.get('logging', 'workflow_level') == 'DEBUG'
316-
if log_debug and hash_exists: # Lazy logging - only debug
314+
# If logging is more verbose than INFO (20), print diff between hashes
315+
if logger.getEffectiveLevel() < 20 and hash_exists: # Lazy logging: only < INFO
317316
split_out = split_filename(hashfiles[0])
318317
exp_hash_file_base = split_out[1]
319318
exp_hash = exp_hash_file_base[len('_0x'):]
@@ -426,7 +425,7 @@ def run(self, updatehash=False):
426425
try:
427426
result = self._run_interface(execute=True)
428427
except Exception:
429-
logger.warning('[Node] Exception "%s" (%s)', self.fullname, outdir)
428+
logger.warning('[Node] Error on "%s" (%s)', self.fullname, outdir)
430429
# Tear-up after error
431430
os.remove(hashfile_unfinished)
432431
raise

0 commit comments

Comments
 (0)