Skip to content

Commit 084c7b0

Browse files
Log file paths converted to string to comply with logging parameter types (#172)
2 parents 2cf60cf + e54fb61 commit 084c7b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Python_Engine/Python/src/python_toolkit/bhom/analytics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def wrapper(*args, **kwargs) -> Any:
8585
finally:
8686
log_file = BHOM_LOG_FOLDER / f"{function.__module__.split('.')[0]}_{datetime.now().strftime('%Y%m%d')}.log"
8787

88-
if ANALYTICS_LOGGER.handlers[0].baseFilename != log_file:
88+
if ANALYTICS_LOGGER.handlers[0].baseFilename != str(log_file):
8989
ANALYTICS_LOGGER.handlers[0].close()
90-
ANALYTICS_LOGGER.handlers[0].baseFilename = log_file
90+
ANALYTICS_LOGGER.handlers[0].baseFilename = str(log_file)
9191

9292
ANALYTICS_LOGGER.info(
9393
json.dumps(exec_metadata, default=str, indent=None)

Python_Engine/Python/src/python_toolkit/bhom/logging/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
formatter = logging.Formatter("%(message)s")
1414
handler = RotatingFileHandler(
15-
BHOM_LOG_FOLDER / f"{TOOLKIT_NAME}_{datetime.now().strftime('%Y%m%d')}.log",
15+
str(BHOM_LOG_FOLDER / f"{TOOLKIT_NAME}_{datetime.now().strftime('%Y%m%d')}.log"),
1616
mode="a",
1717
maxBytes=25 * 1024 * 1024, # 25mb max before file overwritten
1818
backupCount=1,

0 commit comments

Comments
 (0)