diag log: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(<code> tidy + addition of "Each call creates a new line in the file." to description + 2 examples)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Dumps the argument's value to the [[arma.RPT|report file]]. |= Description
| Dumps the argument's value to the [[arma.RPT|report file]]. Each call creates a new line in the file. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 22: Line 22:




|x1= <code>diag_log time;</code>|= EXAMPLE1
|x1= <code>[[diag_log]] [[time]];</code>|= Example 1
|x2= <code>diag_log format ["%1, %2", player, time];</code>|= EXAMPLE2
|x2= <code>[[diag_log]] [[format]] ["%1, %2", [[player]], [[time]]<nowiki>]</nowiki>;</code>|= Example 2
|x3= <code>_arr = [1, "foo", [[player]], "bar"];
{
    [[diag_log]] [[Magic Variables|_x]];
} [[forEach]] _arr; // Creates 4 entries on 4 lines</code>|= Example 3
|x4= <code>_arr = [1, "foo", [[player]], "bar"];
[[diag_log]] _arr;</code>
Creates one entry of e.g. {{Inline code|[1,"foo",B Alpha 1-1:1 (Player Name),"bar"]}}|= Example 4


____________________________________________________________________________________________
____________________________________________________________________________________________

Revision as of 12:24, 29 March 2014


Hover & click on the images for description

Description

Description:
Dumps the argument's value to the report file. Each call creates a new line in the file.
Groups:
Uncategorised

Syntax

Syntax:
diag_log anything
Parameters:
anything: Anything -
Return Value:
Nothing

Examples

Example 1:
diag_log time;
Example 2:
diag_log format ["%1, %2", player, time];
Example 3:
_arr = [1, "foo", player, "bar"]; { diag_log _x; } forEach _arr; // Creates 4 entries on 4 lines
Example 4:
_arr = [1, "foo", player, "bar"]; diag_log _arr; Creates one entry of e.g. [1,"foo",B Alpha 1-1:1 (Player Name),"bar"]

Additional Information

See also:
arma.RPTcopyToClipboardcopyFromClipboarddiag_fpsdiag_fpsmindiag_framenodiag_tickTime

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

Worldeater
ARMA2 crashes when diag_log is fed more than 1019 characters. diag_log might also crash ARMA2 when fed with less characters in some cases.

Note: This issue has been fixed in patch 1.04
Master85
To dump a string without "" use text.
Demonized
in patch 1.59 there is a limit of 1044 characters to be printed, no error or crash but diag_log line will simply end at character number 1044.
Killzone_Kid
For convenience and easy debugging use my free debug_console extension which will automatically launch a console window with your output. It can also write to file. To install drop debug_console.dll into main Arma directory. Examples: "debug_console" callExtension "Default grey"; //default output "debug_console" callExtension "Red line without timestamp #1000"; //red with timestamp "debug_console" callExtension "Yellow line with timestamp #1101"; //yellow without timestamp "debug_console" callExtension "Writing to file ~0001"; //output to file "debug_console" callExtension ""; //empty line "debug_console" callExtension "A"; //beep sound "debug_console" callExtension "C"; //clear console "debug_console" callExtension "X"; //close console Direct Download: http://killzonekid.com/pub/debug_console_v3.0.zip

Bottom Section