From 0205007463009239885ceec85a649b24855068fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Kr=C3=B6ppl?= Date: Wed, 24 Jan 2024 00:22:05 +0100 Subject: [PATCH] docs: add instructions for logging --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index d18c4fa..54fefcb 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,29 @@ nmcli connection up "vpn-name" +## Logging + +Available for the launcher itself and all plugins, logging is implemented with the [tracing](https://docs.rs/tracing/latest/tracing/) crate. It has been pre-configured and re-exported as part of this crate. The standard **info!**, **warn!**, **error!**, and **debug!** macros can be used, after this use statement: + +```rust +use pop_launcher_toolkit::plugin_trait::tracing::*; +``` + +Per-plugin, a log file will be created in this directory: `~/.local/state/` + +
+Example log file paths: + +```bash +~/.local/state/pop-launcher.log + your-plugin.log + ... +``` + +
+ +The log level of the launcher and all its plugins (official and community) can be changed per-user in the GNOME extension settings: **Extensions** > **Pop Shell** > **Settings** > **Log Level** + ## JSON IPC Whether implementing a frontend or a plugin, the JSON codec used by pop-launcher is line-based. Every line will contain a single JSON message That will be serialized or decoded as a `Request`, `PluginResponse`, or `Response`. These types can be referenced in [docs.rs](https://docs.rs/pop-launcher). IPC is based on standard input/output streams, so you should take care not to write logs to stdout.