big refactor to isolate functionality. adds milsim_fnc_log.

This commit is contained in:
2024-01-30 15:05:02 -08:00
parent f52011cbc4
commit 9ec51a5e19
20 changed files with 714 additions and 375 deletions

24
functions/util/fn_log.sqf Normal file
View File

@@ -0,0 +1,24 @@
/*
Function: milsim_fnc_log
Description:
Used to log messages to the server RPT file.
Parameters:
0: STRING - component name.
1: STRING - message to log.
2: ARRAY - Key value pairs of data to log.
*/
params [
["_component", "", [""]],
["_message", "", [""]],
["_data", [], [[]]]
];
private _hash = createHashMapFromArray _data;
private _json = [_hash] call CBA_fnc_encodeJSON;
_log = format ["[milsim] (%1) (%2) (%3) :: %4", _component, _fnc_scriptNameParent, _message, _json];
diag_log text _log;