big refactor to isolate functionality. adds milsim_fnc_log.
This commit is contained in:
24
functions/util/fn_log.sqf
Normal file
24
functions/util/fn_log.sqf
Normal 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;
|
||||
Reference in New Issue
Block a user