Skip to content

Log

Overview

You can log messages to your console while the game is running via the log! macro.

API

log!

Logs a message to the stdout on native and to the devtools console on web.

log!(&str, ...args)

Usage

Log a static message

log!("hello!");

Interpolate variables

Log your game state:

let state = GameState::load();
log!("My game state = {:?}", state);

You can interpolate multiple vars:

let (canvas_width, canvas_height) = resolution();
log!("Canvas - width = {:?}, height = {:?}", canvas_width, canvas_height);