Pixel-Composer/scripts/logger/logger.gml

28 lines
612 B
Plaintext
Raw Normal View History

#region globals
global.LOG_LEVEL = 0;
2024-04-30 05:57:34 +02:00
function LOG_BLOCK_START() { INLINE; global.LOG_LEVEL++; }
function LOG(text) {
2023-11-08 08:38:04 +01:00
INLINE
var s = "";
repeat(global.LOG_LEVEL - 1)
s += " ";
2023-06-01 10:32:21 +02:00
s += "├ ";
print(s + string(text));
}
function LOG_LINE(text) {
2023-11-08 08:38:04 +01:00
INLINE
LOG_BLOCK_START();
LOG(text);
LOG_BLOCK_END();
}
2024-04-30 05:57:34 +02:00
function LOG_IF(cond, text) { INLINE; if(cond) LOG(text); }
function LOG_LINE_IF(cond, text) { INLINE; if(cond) LOG_LINE(text); }
2024-04-30 05:57:34 +02:00
function LOG_BLOCK_END() { INLINE; global.LOG_LEVEL--; }
function LOG_END() { INLINE; global.LOG_LEVEL = 0; }
#endregion