Sweet Logger
Hey - that's sweet logger you got there!
A Godot 4 addon that makes reading logs and debugging sane when you run multiple game instances at once.
It's meant as a drop-in for print() but each line carries more context.
When you're testing multiplayer locally (host + clients in separate run instances), the editor console quickly becomes unreadable. Sweet Logger formats each line the same way so you can tell at a glance what kind of log it is, which peer it came from, when it happened, and which script/function produced it.
Features
- Peer-aware labels - tags each line as
SERVER, a client peer ID, orDISCONNECTED - Color-coded peers - consistent colors per peer so interleaved console output is easy to scan
- Log levels -
log,info,warning,error,debugwith distinct colors - Script context - optional script and function name columns
- Local timestamps -
mm:ss:msby default (optional hours) - Rich console output - uses
print_richwith aligned columns
Installation
From the Godot Asset Store
- In Godot, open the AssetStore tab.
- Search for Sweet Logger and download it.
- Open Project → Project Settings → Plugins and enable Sweet Logger.
- The plugin registers a
SweetLoggerautoload automatically.
Manual
- Copy the
addons/sweet-loggerfolder into your project'saddons/directory. - In Godot, open Project → Project Settings → Plugins and enable Sweet Logger.
- The plugin registers a
SweetLoggerautoload automatically.
Usage
Call the autoload from anywhere:
SweetLogger.info("Player joined", [], "lobby.gd", "on_peer_connected")
SweetLogger.warning("High latency: {0}ms", [rtt], "net.gd", "_process")
SweetLogger.error("RPC failed", [], "sync.gd", "apply_state")
SweetLogger.debug("Tick {0}", [tick], "game.gd", "_physics_process")
SweetLogger.log("Hello from peer")
Message formatting
Pass optional args and use {0}, {1}, … placeholders:
SweetLogger.info("Spawned {0} at {1}", [entity_name, position], "spawner.gd", "spawn")
API
| Method | Level |
|---|---|
SweetLogger.log(message, args=[], script_name="", function_name="") |
General |
SweetLogger.info(...) |
Info |
SweetLogger.warning(...) |
Warning |
SweetLogger.error(...) |
Error |
SweetLogger.debug(...) |
Debug |
All methods share the same signature: message, optional format args, optional script name, optional function name.
Configuration
On the SweetLogger autoload (or in the inspector when selected):
| Export | Default | Description |
|---|---|---|
SHOW_SCRIPT_NAME |
true |
Include the script name column |
SHOW_FUNCTION_NAME |
true |
Include the function name column |
SHOW_TIMESTAMP_HOURS |
false |
Use hh:mm:ss:ms instead of mm:ss:ms |
Log line layout
Each line is roughly:
[LEVEL][timestamp][PEER][script::function] message
- LEVEL - color by type (info blue, warning yellow, error red, etc.)
- timestamp - local time for correlating events across instances
- PEER -
SERVER, numeric client ID, orDISCONNECTED, each with a stable color - script::function - where the log was emitted (when you pass those args)
License
MIT - see LICENSE.
Changelog for version Sweet Logger 1.01
No changelog provided for this version.