Critical;
}
+debug_set_level :: (level: Log_Level) {
+ log_level = level;
+}
+
debug_log :: (level: Log_Level, format: str, args: ..any) {
debug_log_va(level, format, ~~args);
}
debug_log_va :: (level: Log_Level, format: str, args: [] any) {
+ if level < log_level do return;
+
buf: [2048] u8;
output := conv.format_va(buf, format, args);
- printf("[{}] {}\n", level_string(level), output);
+ printf("[{w5}] {}\n", level_string(level), output);
}
#local level_string :: (level: Log_Level) => {
switch level {
case .Debug do return "DEBUG";
- case .Info do return "INFO ";
- case .Warning do return "WARN ";
+ case .Info do return "INFO";
+ case .Warning do return "WARN";
case .Error do return "ERROR";
- case .Critical do return "CRIT ";
+ case .Critical do return "CRIT";
}
- return " ";
+ return "";
}
+
+#local log_level := Log_Level.Debug;
\ No newline at end of file
-Vector2 :: struct [conv.Custom_Format.{format_vector2}] {
+Vector2 :: struct {
+ #struct_tag conv.Custom_Format.{format_vector2}
x, y: f32;
}
-Vector3i :: struct [conv.Custom_Format.{format_vector3i}] {
+Vector3i :: struct {
+ #struct_tag conv.Custom_Format.{format_vector3i}
x, y, z: i32;
}
-Vector3 :: struct [conv.Custom_Format.{format_vector3}] {
+Vector3 :: struct {
+ #struct_tag conv.Custom_Format.{format_vector3}
x, y, z: f32;
mag :: macro (v: Vector3) => math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z);