first draft of log explorer
This commit is contained in:
1 parent
191e69eb1d
commit
400837b41a
16 files changed
+1495
-79
No files matched your search
+58
-72
@@ -1,96 +1,82 @@
|
||||
# Extension VS Code AppDaemon
|
||||
# AppDaemon for Home Assistant — VS Code extension
|
||||
|
||||
Extension VS Code pour développer et administrer les applications AppDaemon
|
||||
utilisées avec Home Assistant.
|
||||
Version: **0.2.0**
|
||||
|
||||
Version documentée : `0.1.0`
|
||||
## Install or update
|
||||
|
||||
## Installation
|
||||
Open **Extensions**, select **… → Install from VSIX…**, and choose
|
||||
`vscode-appdaemon-0.2.0.vsix`. Reload VS Code when prompted.
|
||||
|
||||
1. Ouvrir **Extensions** dans VS Code (`Ctrl+Shift+X` / `Cmd+Shift+X`).
|
||||
2. Cliquer sur `...`, puis **Install from VSIX...**.
|
||||
3. Sélectionner `vscode-appdaemon-0.1.0.vsix` dans ce dossier.
|
||||
4. Recharger VS Code si nécessaire.
|
||||
## Log explorer
|
||||
|
||||
## Configuration
|
||||
Select **$(list-tree) AD Logs** in the VS Code status bar, or run **AppDaemon: Explore Logs** from the Command Palette. The explorer opens in a central editor tab, including when no document is open.
|
||||
|
||||
Les réglages sont disponibles dans **Paramètres → Extensions → AppDaemon**, ou
|
||||
dans `.vscode/settings.json` :
|
||||
By default, it reads the existing AppDaemon text logs from the workspace:
|
||||
|
||||
- `logs/appdaemon.log`
|
||||
- `logs/error.log`
|
||||
- `logs/virtualsensors.log`
|
||||
|
||||
The explorer groups lines by the app name in the standard AppDaemon log format. It provides INFO/WARNING/ERROR counts, expandable app histories, relative timestamps, sorting by latest activity or app name, text/time/level filters, live updates, copy/paste, raw-log navigation, and archived-log import. Duplicate error lines found in multiple files are merged. The log reader handles file rotation, truncation, multiline exceptions, UTF-8, and legacy Windows-1252 bytes.
|
||||
|
||||
The standard AppDaemon text logs do not contain causal links or reliable initialization boundaries. The details panel will say so for ordinary entries. Existing messages that already contain trace or initialization metadata can still be grouped or linked; the explorer does not create that metadata. **Open history** can also load archived files. No AppDaemon Python changes are needed for this raw-log view.
|
||||
|
||||
## Settings
|
||||
|
||||
```json
|
||||
{
|
||||
"appdaemon.haUrl": "http://homeassistant:8123",
|
||||
"appdaemon.haToken": "<TOKEN_HOME_ASSISTANT>",
|
||||
"appdaemon.haToken": "<HOME_ASSISTANT_TOKEN>",
|
||||
"appdaemon.adUrl": "http://localhost:5050",
|
||||
"appdaemon.errorLogPath": "logs/error.log",
|
||||
"appdaemon.mainLogPath": "logs/appdaemon.log",
|
||||
"appdaemon.entityRefreshInterval": 300
|
||||
"appdaemon.entityRefreshInterval": 300,
|
||||
"appdaemon.logExplorerPaths": [
|
||||
"logs/appdaemon.log",
|
||||
"logs/error.log",
|
||||
"logs/virtualsensors.log"
|
||||
],
|
||||
"appdaemon.logTimezone": "Europe/Berlin",
|
||||
"appdaemon.logEncoding": "auto"
|
||||
}
|
||||
```
|
||||
|
||||
| Réglage | Défaut | Description |
|
||||
| --- | --- | --- |
|
||||
| `appdaemon.haUrl` | `http://localhost:8123` | URL de Home Assistant |
|
||||
| `appdaemon.haToken` | vide | Jeton longue durée Home Assistant |
|
||||
| `appdaemon.adUrl` | `http://localhost:5050` | URL de l’API HTTP AppDaemon |
|
||||
| `appdaemon.errorLogPath` | `logs/error.log` | Journal d’erreurs, relatif au workspace |
|
||||
| `appdaemon.mainLogPath` | `logs/appdaemon.log` | Journal principal, relatif au workspace |
|
||||
| `appdaemon.entityRefreshInterval` | `300` | Rafraîchissement des entités, en secondes |
|
||||
| Setting | Purpose |
|
||||
| --- | --- |
|
||||
| `haUrl`, `haToken` | Home Assistant connection for entity information |
|
||||
| `adUrl` | AppDaemon HTTP API URL |
|
||||
| `errorLogPath`, `mainLogPath` | Log locations relative to the workspace |
|
||||
| `entityRefreshInterval` | Entity refresh interval in seconds |
|
||||
| `logExplorerPaths` | Text log files followed by the explorer |
|
||||
| `logTimezone` | Timezone used to interpret AppDaemon timestamps |
|
||||
| `logEncoding` | `auto`, `utf8`, or `windows-1252` for text logs |
|
||||
|
||||
Ne pas versionner le jeton Home Assistant. Utiliser de préférence les réglages
|
||||
utilisateur ou un fichier local ignoré par Git.
|
||||
Do not commit your Home Assistant token. Use user settings or an ignored local
|
||||
settings file.
|
||||
|
||||
## Raccourcis clavier
|
||||
## Other extension features
|
||||
|
||||
| Action | Windows / Linux | macOS |
|
||||
| --- | --- | --- |
|
||||
| Aller à une application AppDaemon | `Ctrl+Shift+A` | `Cmd+Shift+A` |
|
||||
| Aller à un capteur virtuel | `Ctrl+Shift+V` | `Cmd+Shift+V` |
|
||||
- Home Assistant entity completion and hover information in Python/YAML.
|
||||
- Navigation to AppDaemon app and virtual-sensor definitions.
|
||||
- AppDaemon errors as VS Code diagnostics and an output channel.
|
||||
- Status bar actions for app reload, Home Assistant restart, production mode,
|
||||
error handling and apps defined in the active YAML file.
|
||||
|
||||
Chaque raccourci ouvre une palette permettant de rechercher puis sélectionner
|
||||
l’application ou le capteur souhaité.
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| Ctrl+Shift+A / Cmd+Shift+A | Go to App |
|
||||
| Ctrl+Shift+V / Cmd+Shift+V | Go to Virtual Sensor |
|
||||
|
||||
Pour modifier un raccourci, ouvrir les raccourcis clavier (`Ctrl+K Ctrl+S`),
|
||||
rechercher `AppDaemon`, puis modifier la commande voulue.
|
||||
Commands are available under **AppDaemon:** in the Command Palette: **Go to
|
||||
App**, **Restart Apps in Current File**, **Reload Apps**, **Restart Home
|
||||
Assistant**, **Toggle Production Mode**, **Show Error Log**, **Refresh Entity
|
||||
List**, **Handle Errors**, **Clear Error Diagnostics**, and **Explore Logs**.
|
||||
|
||||
## Commandes disponibles
|
||||
## Verification
|
||||
|
||||
Toutes les commandes sont accessibles avec la palette (`Ctrl+Shift+P` / `Cmd+Shift+P`)
|
||||
en recherchant `AppDaemon:`.
|
||||
|
||||
- **Go to App** : ouvrir la définition d’une application AppDaemon.
|
||||
- **Restart Apps in Current File** : redémarrer les apps du fichier YAML actif.
|
||||
- **Reload Apps** : recharger toutes les applications AppDaemon.
|
||||
- **Restart Home Assistant** : redémarrer Home Assistant ou l’hôte, après confirmation.
|
||||
- **Toggle Production Mode** : activer ou désactiver le mode production.
|
||||
- **Show Error Log** : afficher le journal d’erreurs.
|
||||
- **Refresh Entity List** : recharger les entités Home Assistant.
|
||||
- **Handle Errors** : afficher les erreurs et choisir de les consulter ou de les effacer.
|
||||
- **Clear Error Diagnostics** : effacer les diagnostics d’erreur de VS Code.
|
||||
|
||||
## Barre d’état
|
||||
|
||||
La barre d’état propose des boutons pour recharger AppDaemon, redémarrer Home
|
||||
Assistant, basculer le mode production, consulter les erreurs et redémarrer les
|
||||
apps trouvées dans le fichier YAML actif.
|
||||
|
||||
Quand des erreurs sont détectées, `AD Errors` affiche leur nombre et permet de
|
||||
consulter le journal ou d’effacer les diagnostics.
|
||||
|
||||
## Fonctionnalités d’aide au développement
|
||||
|
||||
Dans les fichiers YAML et Python, l’extension fournit notamment :
|
||||
|
||||
- la complétion des entités Home Assistant ;
|
||||
- les informations au survol des entités ;
|
||||
- la navigation vers les définitions de capteurs virtuels ;
|
||||
- les symboles et la navigation vers les applications AppDaemon ;
|
||||
- la remontée des erreurs présentes dans le journal AppDaemon.
|
||||
|
||||
## Dépannage rapide
|
||||
|
||||
- **Aucune entité proposée** : vérifier `haUrl`, le jeton et l’accès réseau, puis lancer `AppDaemon: Refresh Entity List`.
|
||||
- **Les commandes AppDaemon échouent** : vérifier que l’API HTTP est active et que `appdaemon.adUrl` correspond à la section `http` de `appdaemon.yaml`.
|
||||
- **Les erreurs ne remontent pas** : vérifier `appdaemon.errorLogPath`, relatif à la racine ouverte dans VS Code.
|
||||
- **Un raccourci ne fonctionne pas** : rechercher la commande dans les raccourcis VS Code et vérifier les conflits.
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
The log explorer preview is available at `docs/log-explorer-preview.html` in the
|
||||
workspace; it uses sample data and is not a live log server.
|
||||
Reference in new issue
Block a user