a3_vemf_reloaded/exile_vemf_reloaded/sqf/log.sqf

50 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-05-10 12:19:40 +00:00
/*
Author: IT07
Description:
will log given data if debug is enabled
Params:
_this: ARRAY - contains data required for logging
_this select 0: STRING - prefix. Use "" if none
_this select 1: SCALAR - 0 = error, 1 = info, 2 = special
_this select 2: STRING - the thing to log
Returns:
nothing (use spawn, not call)
*/
2016-07-02 14:24:53 +00:00
if (("debugMode" call VEMFr_fnc_config) > 0) then
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
scopeName "_top";
params [
["_p", "", [""]],
["_t", 3, [0]],
["_l", "", [""]]
];
2016-05-10 12:19:40 +00:00
2016-07-02 14:24:53 +00:00
_do = { diag_log text format["IT07: [VEMFr] %1 -- %2: %3", _p, _this, _l] };
_m = "debugMode" call VEMFr_fnc_config;
if (_t isEqualTo 0) then
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
if (_m isEqualTo 1 OR _m isEqualTo 3) then
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
"ERROR" call _do;
breakOut "_top";
2016-05-10 12:19:40 +00:00
};
};
2016-07-02 14:24:53 +00:00
if (_t isEqualTo 1) then
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
if (_m isEqualTo 2 OR _m isEqualTo 3) then
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
"INFO" call _do;
breakOut "_top";
2016-05-10 12:19:40 +00:00
};
};
2016-07-02 14:24:53 +00:00
if (_t isEqualTo 2) then // This bypasses _m setting. Always logs given params even if debugMode is set to 0
2016-05-10 12:19:40 +00:00
{
2016-07-02 14:24:53 +00:00
"SYSTEM" call _do;
breakOut "_top";
2016-05-10 12:19:40 +00:00
};
};