DeltaLoaderDocs
  1. Home
  2. Developer Documentation
  3. Logging and debugging

Logging and debugging

Print, read logs and use graphics debuggers.

Logging#

cpp
sw::mod::log("x = %d", x);   // console window and %TEMP%\stormworks_mods.log, with a line end

sw/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.

Documentation for game build 1.15.26. Found a mistake? Open an issue.