intersystems / intersystems/ipm
Implement Global Diagnostic LogLevels (Telemetry)
- Dominant language
- ObjectScript
- Stars
- 41
- Forks
- 29
- Avg merge
- 23h 54m
- Merged PRs (30d)
- 4
Description
The current `history` (log) command is an excellent **Audit Trail** for transactions (install, load, etc.). However, it lacks **Operational Telemetry**. If a `search` fails due to a network timeout, or a dependency resolution fails during a complex `install`, there is currently no persistent record of the *internal logic* or *network traffic* that led to the failure.
### **Proposed Solution**
Introduce a global `LogLevel` configuration that allows the user to toggle the depth of information captured by the IPM engine. This follows industry standards (npm, Cargo) by separating "What was changed" (History) from "How it was processed" (Diagnostics).
### **Proposed Configuration**
I suggest adding a new configuration setting:
`zpm:USER> config set LogLevel <0-3>`
| Level | Name | Description |
| --- | --- | --- |
| **0** | **Minimal** | Default. Only logs entries currently found in `history find`. |
| **1** | **Verbose** | Logs all commands (including `search`, `list`, `repo`) and their execution time. |
| **2** | **Diagnostic** | Adds Network Telemetry: Logs HTTP request/response codes, Latency, and Registry URLs. |
| **3** | **Trace** | Adds Logic Telemetry: Internal dependency tree resolution steps and full ObjectScript stack traces for errors. |
---
### **New Feature: `log trace**`
To complement the current `history find` command, I propose a `log trace` (or `history trace`) command to view this low-level data.
**Example Use Case:**
1. User sets `config set LogLevel 2`.
2. User runs `search some-package` and gets 0 results.
3. User runs `log trace` and sees:
> `14:05:22 | GET https://pm.community.intersystems.com/query | Status: 407 (Proxy Auth Required) | Latency: 150ms`
Contributor guide
Assessment
This issue has not been assessed yet.