mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-11 04:54:06 +01:00
40 lines
576 B
Plaintext
40 lines
576 B
Plaintext
|
#region globals
|
||
|
global.LOG_LEVEL = 0;
|
||
|
|
||
|
function LOG_BLOCK_START() {
|
||
|
global.LOG_LEVEL++;
|
||
|
}
|
||
|
|
||
|
function LOG(text) {
|
||
|
var s = "";
|
||
|
repeat(global.LOG_LEVEL - 1)
|
||
|
s += " ";
|
||
|
s += "|- ";
|
||
|
|
||
|
print(s + string(text));
|
||
|
}
|
||
|
|
||
|
function LOG_LINE(text) {
|
||
|
LOG_BLOCK_START();
|
||
|
LOG(text);
|
||
|
LOG_BLOCK_END();
|
||
|
}
|
||
|
|
||
|
function LOG_IF(cond, text) {
|
||
|
if(!cond) return;
|
||
|
LOG(text);
|
||
|
}
|
||
|
|
||
|
function LOG_LINE_IF(cond, text) {
|
||
|
if(!cond) return;
|
||
|
LOG_LINE(text);
|
||
|
}
|
||
|
|
||
|
function LOG_BLOCK_END() {
|
||
|
global.LOG_LEVEL--;
|
||
|
}
|
||
|
|
||
|
function LOG_END() {
|
||
|
global.LOG_LEVEL = 0;
|
||
|
}
|
||
|
#endregion
|