-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Checklist
- My issue is specific & actionable.
- I am not suggesting a protocol enhancement.
- I have searched on the issue tracker for my issue.
Description
Enhancement Request
Add GET method support to the /api/v0/log/level
API endpoint to enable querying current log levels, complementing the existing POST functionality for setting levels.
Current Behavior
The /api/v0/log/level
API currently only supports POST requests for setting log levels:
POST /api/v0/log/level?arg=subsystem&arg=level
- sets subsystem log levelPOST /api/v0/log/level?arg=all&arg=level
- sets global log level
There is no way to query the current log levels.
Proposed Enhancement
Add GET method support with the following behavior:
-
Get global log level:
GET /api/v0/log/level Response: {"Level": "info"}
-
Get subsystem log level:
GET /api/v0/log/level?arg=autonat Response: {"Level": "debug"}
-
Get all subsystem levels (optional):
GET /api/v0/log/level?arg=* Response: { "Global": "info", "Subsystems": { "autonat": "debug", "dht": "info", "libp2p": "warn" } }
We could also update /api/v0/log/ls to provide this information, but that would be a breaking change.
Motivation
This enhancement would enable:
- Web UI applications to display current log level state instead of guessing or defaulting to "info"
- Debugging tools to inspect current logging configuration
- Configuration management scripts to query before making changes
- Better user experience in applications like ipfs-webui where users can see and manage log levels
Currently, applications that build log management interfaces have no way to show users what the current settings actually are, leading to poor user experience and potential confusion about the actual logging state.
Implementation Notes
- Should maintain backward compatibility with existing POST behavior
- GET requests should not modify state
This would bring the log level API in line with other Kubo APIs that support both GET (query) and POST (modify) operations.
Related ipshipyard/roadmaps#11