Skip to content

蟹状星云开发工具

CrabNebula 提供了一个免费的 DevTools 应用,用于 Tauri,这是其与 Tauri 项目合作的一部分。该应用允许你通过捕获 Tauri 应用的嵌入式资源、Tauri 配置文件、日志和跨度来为你的 Tauri 应用进行检测,并提供一个网页前端,以实时无缝地可视化数据。

使用 CrabNebula 开发工具,你可以检查应用的日志事件(包括依赖的日志)、追踪命令调用的性能以及整体 Tauri API 的使用情况,并提供一个专门用于 Tauri 事件和命令的界面,包括负载、响应、内部日志和执行跨度。

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

要启用 CrabNebula 开发工具,请安装 devtools crate:

🌐 To enable the CrabNebula DevTools, install the devtools crate:

cargo add tauri-plugin-devtools@2.0.0

并尽快在你的主函数中初始化这个插件:

🌐 And initialize the plugin as soon as possible in your main function:

fn main() {
// This should be called as early in the execution of the app as possible
#[cfg(debug_assertions)] // only enable instrumentation in development builds
let devtools = tauri_plugin_devtools::init();
let mut builder = tauri::Builder::default();
#[cfg(debug_assertions)]
{
builder = builder.plugin(devtools);
}
builder
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

然后照常运行你的应用,如果一切设置正确,开发工具将打印以下信息:

🌐 And then run your app as usual, if everything is set up correctly devtools will print the following message:

DevTools message on terminal

欲了解更多信息,请参阅 CrabNebula 开发者工具 文档。

🌐 For more information, see the CrabNebula DevTools documentation.


Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站