Skip to content

Commit fc68c10

Browse files
xnov18behackl
andauthored
Add info-level logging for config files read and enhance output (#4375)
Co-authored-by: Benjamin Hackl <[email protected]>
1 parent d0521fa commit fc68c10

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

manim/_config/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,14 @@ def make_config_parser(
122122
# read_file() before calling read() for any optional files."
123123
# https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read
124124
parser = configparser.ConfigParser()
125+
logger.info(f"Reading config file: {library_wide}")
125126
with library_wide.open() as file:
126127
parser.read_file(file) # necessary file
127128

128129
other_files = [user_wide, Path(custom_file) if custom_file else folder_wide]
130+
for path in other_files:
131+
if path.exists():
132+
logger.info(f"Reading config file: {path}")
129133
parser.read(other_files) # optional files
130134

131135
return parser

manim/cli/cfg/group.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ def write(level: str | None = None, openfile: bool = False) -> None:
267267

268268
@cfg.command(context_settings=cli_ctx_settings)
269269
def show() -> None:
270+
console.print("CONFIG FILES READ", style="bold green underline")
271+
for path in config_file_paths():
272+
if path.exists():
273+
console.print(f"{path}")
274+
console.print()
275+
270276
parser = make_config_parser()
271277
rich_non_style_entries = [a.replace(".", "_") for a in RICH_NON_STYLE_ENTRIES]
272278
for category in parser:

0 commit comments

Comments
 (0)