- Home
- Developer Documentation
- Logging and debugging
Logging and debugging
Print, read logs and use graphics debuggers.
Logging#
sw::mod::log("x = %d", x); // console window and %TEMP%\stormworks_mods.log, with a line endsw/console.hpp gives direct access: opening the window, writing, drawing and sw::console::log_path().
Console window#
The launcher's Log page shows the log; Show console brings the console to the front while the game runs.
Graphics debuggers (RenderDoc, PIX)#
These tools must start the game themselves, which would bypass the loader. Use Settings → Debug start (RenderDoc): it prepares the mod folders and waits for stormworks64.exe. Then start the game from the debugger. Do not start the launcher itself inside RenderDoc.
Tips#
- Check every return value; a mismatching build returns false or nullptr.
- Hook failures name a
HookStatus; see Events and hooks. - A crash inside a callback usually means: callback too long, an exception, or an object used before
is_instance_of.