mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-06-07 08:14:48 +00:00
22 lines
385 B
Plaintext
Executable File
22 lines
385 B
Plaintext
Executable File
class Debug {
|
|
Bool enabled;
|
|
I64 bookmark;
|
|
I64 counter;
|
|
};
|
|
|
|
Debug debug;
|
|
debug.bookmark = 0;
|
|
debug.counter = 0;
|
|
debug.enabled = FALSE;
|
|
|
|
U0 debug_print(U8 *fmt, ...) {
|
|
if (!debug.enabled || debug.counter < debug.bookmark) {
|
|
debug.counter++;
|
|
return;
|
|
}
|
|
U8 *buf = StrPrintJoin(NULL, fmt, argc, argv);
|
|
"[%05d] %s", debug.counter, buf;
|
|
Free(buf);
|
|
debug.counter++;
|
|
}
|