Skip to content

Commit d9002bb

Browse files
committed
add debug logging
1 parent b39a6a0 commit d9002bb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mne_bids/path.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: BSD-3-Clause
55

66
import glob
7+
import inspect
78
import json
89
import os
910
import re
@@ -1996,6 +1997,7 @@ def get_entity_vals(
19961997
.. [1] https://bids-specification.rtfd.io/en/latest/common-principles.html#entities
19971998
19981999
"""
2000+
params = inspect.signature(get_entity_vals).parameters # for debug messages
19992001
root = _check_fname(
20002002
fname=root,
20012003
overwrite="read",
@@ -2120,6 +2122,15 @@ def get_entity_vals(
21202122
value = f"{entity_long_abbr_map[entity_key]}-{value}"
21212123
if value not in values:
21222124
values.append(value)
2125+
# display all non-default params passed into the function
2126+
param_string = ", ".join(
2127+
f"{k}={v!r}"
2128+
for k, v in inspect.currentframe().f_back.f_locals.items()
2129+
if k in params and v != params[k].default
2130+
)
2131+
logger.debug(
2132+
"%s matched by get_entity_vals(%s)", filename.name, param_string
2133+
)
21232134
return sorted(values)
21242135

21252136

0 commit comments

Comments
 (0)