online multiplayer chess game (note server currently down)
Diffstat (limited to 'Log.gd')
-rw-r--r--Log.gd27
1 files changed, 27 insertions, 0 deletions
diff --git a/Log.gd b/Log.gd
new file mode 100644
index 0000000..e4a5d26
--- /dev/null
+++ b/Log.gd
@@ -0,0 +1,27 @@
+extends Node
+
+
+static func info(information) -> void: # logs the input string
+ print("[i] " + to_str(information))
+
+
+static func debug(information) -> void: # logs the input string on debug builds
+ if Debug.debug:
+ print("[d] " + to_str(information))
+
+
+static func err(information) -> void: # logs the input string to stderr
+ printerr("[E]" + to_str(information))
+
+
+static func to_str(arg) -> String:
+ if typeof(arg) == TYPE_ARRAY:
+ return arr2str(arg)
+ return str(arg)
+
+
+static func arr2str(arr: Array) -> String:
+ var string := ""
+ for i in arr:
+ string += str(i) + " "
+ return string