Skip to content

Commit 81fb679

Browse files
Fix str/Path type confusion.
1 parent 5104f97 commit 81fb679

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/seclab_taskflow_agent/path_utils.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def mcp_data_dir(packagename: str, mcpname: str, env_override: str | None) -> Pa
3232
p.mkdir(parents=True, exist_ok=True)
3333
return p
3434

35-
def log_dir() -> str:
35+
def log_dir() -> Path:
3636
"""
3737
Get the directory path for storing log files for the seclab-taskflow-agent.
3838
@@ -46,6 +46,18 @@ def log_dir() -> str:
4646
appauthor="GitHubSecurityLab",
4747
ensure_exists=True)
4848

49+
def log_file(filename: str) -> Path:
50+
"""
51+
Construct the full path to a log file in the user log directory.
52+
53+
Parameters:
54+
filename (str): The name of the log file.
55+
56+
Returns:
57+
Path: The full path to the log file in the user log directory.
58+
"""
59+
return log_dir().joinpath(filename)
60+
4961
def log_file_name(filename: str) -> str:
5062
"""
5163
Construct the full path to a log file in the user log directory.
@@ -56,4 +68,4 @@ def log_file_name(filename: str) -> str:
5668
Returns:
5769
str: The full path to the log file in the user log directory.
5870
"""
59-
return os.path.join(log_dir(), filename)
71+
return str(log_file(filename))

0 commit comments

Comments
 (0)