-
Notifications
You must be signed in to change notification settings - Fork 6
Use platformdirs.user_log_dir to create a log directory #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use platformdirs.user_log_dir to create a log directory #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR centralizes log file paths using platformdirs.user_log_dir, moving logs from a hardcoded local directory to per-user OS-appropriate locations.
- Replace hardcoded "logs/" paths with path_utils.log_file_name across modules.
- Initialize logging to write to files returned by log_file_name in several components.
- Remove Docker and devcontainer assumptions about a local logs directory.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/seclab_taskflow_agent/render_utils.py | Switch render output logging to logging.debug with a platformdirs-based log file path; adds logging.basicConfig in module. |
| src/seclab_taskflow_agent/path_utils.py | Introduces log_dir and log_file_name using platformdirs.user_log_dir to resolve log locations. |
| src/seclab_taskflow_agent/mcp_servers/memcache/memcache.py | Moves logging initialization to use log_file_name for mcp_memcache.log. |
| src/seclab_taskflow_agent/mcp_servers/logbook/logbook.py | Updates logging to use log_file_name for mcp_logbook.log and adjusts imports. |
| src/seclab_taskflow_agent/mcp_servers/echo/echo.py | Updates logging to use log_file_name, but uses an incorrect relative import for path_utils. |
| src/seclab_taskflow_agent/mcp_servers/codeql/mcp_server.py | Moves logging initialization to use log_file_name for mcp_codeql.log. |
| src/seclab_taskflow_agent/mcp_servers/codeql/client.py | Attempts to use log_file_name for stderr log path, but has an invalid import and a malformed string literal. |
| src/seclab_taskflow_agent/main.py | Switches RotatingFileHandler path to log_file_name, removing manual logs dir creation. |
| docker/run.sh | Removes creation of local logs/data directories and DATA_DIR env mount. |
| README.md | Removes example bind mount of local logs directory. |
| .gitignore | Removes ignore rules for local logs directory. |
| .dockerignore | Removes logs/** ignore entry. |
| .devcontainer/post-create.sh | Removes logs/data directory creation and .env entry for CODEQL_DBS_BASE_PATH. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Does this create the logs in the |
Yes. On Linux, it creates the directory |
|
Can you make it so that you can overwrite with env like the data dir? Otherwise it'll be a pain to read the logs when running the docker. |
…vironment variable.
|
smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
smoke test |
|
|
smoke test |
|
|
smoke test |
Deployment Triggered 🚀kevinbackhouse, started a branch deployment to smoketest (branch: You can watch the progress here 🔗 Details{
"type": "branch",
"environment": {
"name": "smoketest",
"url": null
},
"deployment": {
"timestamp": "2025-12-03T16:02:55.789Z",
"logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/19900325006"
},
"git": {
"branch": "2f65245ad9fa48d233f323bd201425be89d92cba",
"commit": "2f65245ad9fa48d233f323bd201425be89d92cba",
"verified": true,
"committer": "web-flow",
"html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/2f65245ad9fa48d233f323bd201425be89d92cba"
},
"context": {
"actor": "kevinbackhouse",
"noop": false,
"fork": true,
"comment": {
"created_at": "2025-12-03T16:02:34Z",
"updated_at": "2025-12-03T16:02:34Z",
"body": "smoke test",
"html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/105#issuecomment-3607583345"
}
},
"parameters": {
"raw": null,
"parsed": null
}
} |
Deployment Results ❌kevinbackhouse had a failure when deploying branch Details{
"status": "failure",
"environment": {
"name": "smoketest",
"url": null
},
"deployment": {
"id": 3413652958,
"timestamp": "2025-12-03T16:03:37.851Z",
"logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/19900325006",
"duration": 42
},
"git": {
"branch": "2f65245ad9fa48d233f323bd201425be89d92cba",
"commit": "2f65245ad9fa48d233f323bd201425be89d92cba",
"verified": true
},
"context": {
"actor": "kevinbackhouse",
"noop": false,
"fork": true
},
"reviews": {
"count": 1,
"decision": "APPROVED"
},
"parameters": {
"raw": null,
"parsed": null
}
} |
|
smoke test |
|
|
smoke test |
Deployment Triggered 🚀kevinbackhouse, started a branch deployment to smoketest (branch: You can watch the progress here 🔗 Details{
"type": "branch",
"environment": {
"name": "smoketest",
"url": null
},
"deployment": {
"timestamp": "2025-12-03T16:11:29.115Z",
"logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/19900593194"
},
"git": {
"branch": "62f6771cff934846ca7498339a8589b464c7404f",
"commit": "62f6771cff934846ca7498339a8589b464c7404f",
"verified": true,
"committer": "web-flow",
"html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/62f6771cff934846ca7498339a8589b464c7404f"
},
"context": {
"actor": "kevinbackhouse",
"noop": false,
"fork": true,
"comment": {
"created_at": "2025-12-03T16:11:10Z",
"updated_at": "2025-12-03T16:11:10Z",
"body": "smoke test",
"html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/105#issuecomment-3607625298"
}
},
"parameters": {
"raw": null,
"parsed": null
}
} |
Deployment Results ✅kevinbackhouse successfully deployed branch Details{
"status": "success",
"environment": {
"name": "smoketest",
"url": null
},
"deployment": {
"id": 3413712610,
"timestamp": "2025-12-03T16:15:03.030Z",
"logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/19900593194",
"duration": 214
},
"git": {
"branch": "62f6771cff934846ca7498339a8589b464c7404f",
"commit": "62f6771cff934846ca7498339a8589b464c7404f",
"verified": true
},
"context": {
"actor": "kevinbackhouse",
"noop": false,
"fork": true
},
"reviews": {
"count": 1,
"decision": "APPROVED"
},
"parameters": {
"raw": null,
"parsed": null
}
} |
Same concept as #99, for the
logsdirectory.