summaryrefslogtreecommitdiff
path: root/client/Root.cs
diff options
context:
space:
mode:
authorJoel Stålnacke <joel@saker.fi>2024-10-13 14:32:14 +0300
committerJoel Stålnacke <joel@saker.fi>2024-10-13 14:32:14 +0300
commit11b2cfa087f5de09b97eb42fb219f563886f6d40 (patch)
tree215a8e65edc0b74a47da63a0c8230b8eadba060f /client/Root.cs
parent53a1cdf5bee2955995dfbf441f5354d1dcfc1e0c (diff)
Add libdjup logging
Diffstat (limited to 'client/Root.cs')
-rw-r--r--client/Root.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/client/Root.cs b/client/Root.cs
index e39a485..b565083 100644
--- a/client/Root.cs
+++ b/client/Root.cs
@@ -13,7 +13,19 @@ public partial class Root : Node2D
public unsafe override void _Ready()
{
RenderingServer.SetDefaultClearColor(Colors.LightGray);
-
+ LibDjup.log_set_output((level, source, line, msg) => {
+ string level_name = level switch
+ {
+ LogLevel.Trace => "trace",
+ LogLevel.Debug => "debug",
+ LogLevel.Info => "info",
+ LogLevel.Warn => "warn",
+ LogLevel.Error => "error",
+ LogLevel.Fatal => "fatal"
+ };
+ GD.Print($"libdjup {source}:{line} {level_name.PadLeft(5, ' ')}: {msg}");
+ });
+
native_world = LibDjup.world_create();
for (int i = 0; i < balls.Length; i++)
{