Skills

Bevy Debugging Profiling

Bevy ECS skill for logs and diagnostics.

Install

npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-debugging-profiling -g -a claude-code -y
Category
Engineering
Updated
19d ago
License
LGPL-3.0
Context cost
Mediumabout 1,972 tokens
Runs scripts
No, instructions only

What it does

Bevy ECS skill for logs and diagnostics. Keywords: Bevy, LogPlugin, DiagnosticsPlugin, FrameTimeDiagnosticsPlugin.

Bevy debugging and profiling

When to use

Load this when a running app should print logs or record frame time, entity count, or process CPU and memory.

ECS shape

  • Logs: LogPlugin is part of DefaultPlugins. Override it with DefaultPlugins.set(LogPlugin { level, filter, .. }). The page's example uses Level::DEBUG and a filter string such as wgpu=error,bevy_render=info,bevy_ecs=trace. The same filter works as RUST_LOG. To bring your own collector, disable this plugin on DefaultPlugins.
  • Diagnostics core: DiagnosticsPlugin adds the core resources. DiagnosticsStore holds the collection. Diagnostic is a timeline of DiagnosticMeasurement values addressed by DiagnosticPath. RegisterDiagnostic adds register_diagnostic on App.
  • Built-in plugins: FrameTimeDiagnosticsPlugin adds frame time, fps, and frame count. EntityCountDiagnosticsPlugin adds an entity count. SystemInformationDiagnosticsPlugin adds cpu_usage and mem_usage percent. LogDiagnosticsPlugin prints diagnostics to the console. FrameCount / FrameCountPlugin count frames since start.
  • Order: the log-diagnostics example adds these plugins after DefaultPlugins because they use the time plugin for timestamps.
  • Schedule: built-in plugins measure on their own. Read DiagnosticsStore when a HUD needs the latest sample. Register a Diagnostic only for a value you measure yourself.

Examples

[dependencies]
bevy = "0.20"

LogPlugin ships inside DefaultPlugins. Replace its level and filter when the default info stream is too quiet or too loud.

use bevy::log::{Level, LogPlugin};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(LogPlugin {
            filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".into(),
            level: Level::DEBUG,
            ..default()
        }))
        .run();
}
Read the whole SKILL.md on GitHub

More in Engineering