Skip to content

Commit a7e0598

Browse files
authored
fix crabnebula-devtools code sample (#3154)
1 parent f258692 commit a7e0598

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed
33.9 KB
Loading

src/content/docs/develop/Debug/crabnebula-devtools.mdx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ sidebar:
66
variant: tip
77
---
88

9+
import { Image } from 'astro:assets';
10+
import devToolsPrint from '@assets/develop/Debug/crabnebula-devtools.png';
11+
912
[CrabNebula](https://crabnebula.dev/) provides a free [DevTools](https://crabnebula.dev/devtools/) application for Tauri as part of its partnership with the Tauri project. This application allows you to instrument your Tauri app by capturing its embedded assets, Tauri configuration file, logs and spans and providing a web frontend to seamlessly visualize data in real time.
1013

1114
With the CrabNebula DevTools you can inspect your app's log events (including logs from dependencies), track down the performance of your command calls and overall Tauri API usage, with a special interface for Tauri events and commands, including payload, responses and inner logs and execution spans.
@@ -20,19 +23,27 @@ And initialize the plugin as soon as possible in your main function:
2023

2124
```rust
2225
fn main() {
23-
#[cfg(debug_assertions)]
24-
let devtools = tauri_plugin_devtools::init(); // initialize the plugin as early as possible
26+
// This should be called as early in the execution of the app as possible
27+
#[cfg(debug_assertions)] // only enable instrumentation in development builds
28+
let devtools = tauri_plugin_devtools::init();
2529

2630
let mut builder = tauri::Builder::default();
2731

2832
#[cfg(debug_assertions)]
29-
builder = builder.plugin(devtools); // then register it with Tauri
33+
{
34+
builder = builder.plugin(devtools);
35+
}
3036

31-
builder.run(tauri::generate_context!())
37+
builder
38+
.run(tauri::generate_context!())
3239
.expect("error while running tauri application");
3340
}
3441
```
3542

43+
And then run your app as usual, if everything is set up correctly devtools will print the following message:
44+
45+
<Image src={devToolsPrint} alt="DevTools message on terminal" />
46+
3647
:::note
3748
In this case we only initialize the devtools plugin for debug applications, which is recommended.
3849
:::

0 commit comments

Comments
 (0)