#17: Add logging
Closes #17.
Following this guide for GNative, the Logger
singleton was created using the node GlobalLogger
.
The GlobalLogger
node contains only one exported property: level_filter
. By default, it's set as Debug
for debug builds and Info
for release builds. It's OK to change the value locally for debugging purposes, but it should remain with the default values when exporting the project.
In order to process logs as soon as possible, this singleton should be the first in the list. When the node initialized, logs are automatically pushed to the Godot console asynchronously according to the selected level_filter
.
Running the manager/game/debug.tscn
scene with level_filter = "Trace"
:
Godot automatically saves logs to files:
It might raise some errors when running from the editor, but that's not really a problem and doesn't happen when the game is exported. It's caused when the GlobalLogger
constructor is called multiple times, causing flexi_logger
to fail.
- Added some tags to the project:
3d
,gdextension
andrust
; - Added the project setting
config/url
; - Workspace members now inherit some values from root's
Cargo.toml
:edition
,publish
, andversion
; -
Dockerfile
anddocker
stage removed. There's a proper branch now; - Added
.rustfmt
.