BIS fnc logFormat: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Created page with "<syntaxhighlight lang=javascript>/* Author: Karel Moricky Description: Display debug message Parameter(s): _this select 0: STRING - Formatted message or first param _this...")
m (Text replacement - "|= |p2=" to "|Parameter1= |p2=")
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<syntaxhighlight lang=javascript>/*
{{Function|Comments=
Author: Karel Moricky
____________________________________________________________________________________________


Description:
| arma3 |Game name=
Display debug message


Parameter(s):
|1.00|Game version=
_this select 0: STRING - Formatted message or first param
_this select n (Optional): ANY - additional parameters


Returns:
____________________________________________________________________________________________
BOOL - true when done
*/


private["_omit"];
| Display debug message.
{{informative|'''allowFunctionsLog''' has to be set to '''1''' in the [[description.ext]] for this function to work.}}|DESCRIPTION=
____________________________________________________________________________________________


if (isNil "_fnc_log_disable") then
| [Text, <Parameters>] call [[BIS_fnc_logFormat]]; |SYNTAX=
{
_omit = false;
}
else
{
_omit = _fnc_log_disable;
};


if (_omit) exitWith {false};
|p1= '''Text''': [[String]] - Formatted message or first param |Parameter1=
|p2= '''Parameters''': [[Any Value]] - Optional, additional parameters |=


private ["_scriptName","_text"];


//--- Insert function name where available
| [[Boolean]] - [[true]] when done |RETURNVALUE=
_scriptName = if (isnil "_fnc_scriptName"/* || isnil "_fnc_scriptNameParent"*/) then {
____________________________________________________________________________________________
""
 
} else {
|x1= <code>["my message goes here"] [[call]] [[BIS_fnc_logFormat]];</code> |=
_fnc_scriptName
};
_scriptName = if (_scriptName != "") then {" [" + _scriptName + "] "} else {" "};


____________________________________________________________________________________________


//--- Display
| [[BIS_fnc_log]] |SEEALSO=
if (typename _this != typename []) then {_this = [_this]};
if (count _this == 0) then {_this = ["<EMPTY ARRAY>"]};
_text = _this select 0;
if (typename _text != typename "") then {_text = str _this;};
_thisLocal = +_this;
_thisLocal set [0,profilename + "/BIS_fnc_log:" + _scriptName + _text];


if (getnumber (missionconfigfile >> "allowFunctionsLog") > 0 || cheatsEnabled) then {
}}
diag_log format _thisLocal
};


true
<h3 style="display:none">Notes</h3>
</syntaxhighlight>
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Debug|{{uc:logFormat}}]]
[[Category:Functions|{{uc:logFormat}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:logFormat}}]]

Revision as of 02:23, 3 September 2019

Hover & click on the images for description

Description

Description:
Display debug message. Template:informative
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[Text, <Parameters>] call BIS_fnc_logFormat;
Parameters:
Text: String - Formatted message or first param
Parameters: Any Value - Optional, additional parameters
Return Value:
Boolean - true when done

Examples

Example 1:
["my message goes here"] call BIS_fnc_logFormat;

Additional Information

See also:
BIS_fnc_log

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section