Skip to content

Commit 0205007

Browse files
docs: add instructions for logging
1 parent b1f6002 commit 0205007

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,29 @@ nmcli connection up "vpn-name"
9595
</pre>
9696
</details>
9797

98+
## Logging
99+
100+
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:
101+
102+
```rust
103+
use pop_launcher_toolkit::plugin_trait::tracing::*;
104+
```
105+
106+
Per-plugin, a log file will be created in this directory: `~/.local/state/`
107+
108+
<details>
109+
<summary>Example log file paths:</summary>
110+
111+
```bash
112+
~/.local/state/pop-launcher.log
113+
your-plugin.log
114+
...
115+
```
116+
117+
</details>
118+
119+
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**
120+
98121
## JSON IPC
99122

100123
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.

0 commit comments

Comments
 (0)