2023-04-03 11:55:45 +02:00
|
|
|
#region globals
|
|
|
|
global.LOG_LEVEL = 0;
|
|
|
|
|
|
|
|
function LOG_BLOCK_START() {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-04-03 11:55:45 +02:00
|
|
|
global.LOG_LEVEL++;
|
|
|
|
}
|
|
|
|
|
|
|
|
function LOG(text) {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-04-03 11:55:45 +02:00
|
|
|
var s = "";
|
|
|
|
repeat(global.LOG_LEVEL - 1)
|
|
|
|
s += " ";
|
2023-06-01 10:32:21 +02:00
|
|
|
s += "├ ";
|
2023-04-03 11:55:45 +02:00
|
|
|
|
|
|
|
print(s + string(text));
|
|
|
|
}
|
|
|
|
|
|
|
|
function LOG_LINE(text) {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-04-03 11:55:45 +02:00
|
|
|
LOG_BLOCK_START();
|
|
|
|
LOG(text);
|
|
|
|
LOG_BLOCK_END();
|
|
|
|
}
|
|
|
|
|
|
|
|
function LOG_IF(cond, text) {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-07-25 20:12:40 +02:00
|
|
|
if(cond) LOG(text);
|
2023-04-03 11:55:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function LOG_LINE_IF(cond, text) {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-07-25 20:12:40 +02:00
|
|
|
if(cond) LOG_LINE(text);
|
2023-04-03 11:55:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function LOG_BLOCK_END() {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-04-03 11:55:45 +02:00
|
|
|
global.LOG_LEVEL--;
|
|
|
|
}
|
|
|
|
|
|
|
|
function LOG_END() {
|
2023-11-08 08:38:04 +01:00
|
|
|
INLINE
|
2023-04-03 11:55:45 +02:00
|
|
|
global.LOG_LEVEL = 0;
|
|
|
|
}
|
|
|
|
#endregion
|