You’ve asked for it, so here it is – V3.0 can now write to file as well. It is backwards compatible with and have all the features of V1.0 and V2.0, so I think I will make a new macro in this post to include all the commands.
//debug_console.hpp
#define conBeep() "debug_console" callExtension ("A")
#define conClear() "debug_console" callExtension ("C")
#define conClose() "debug_console" callExtension ("X")
#define conWhite(_msg) "debug_console" callExtension (_msg + "#1110")
#define conWhiteTime(_msg) "debug_console" callExtension (_msg + "#1111")
#define conRed(_msg) "debug_console" callExtension (_msg + "#1000")
#define conRedTime(_msg) "debug_console" callExtension (_msg + "#1001")
#define conGreen(_msg) "debug_console" callExtension (_msg + "#0100")
#define conGreenTime(_msg) "debug_console" callExtension (_msg + "#0101")
#define conBlue(_msg) "debug_console" callExtension (_msg + "#0010")
#define conBlueTime(_msg) "debug_console" callExtension (_msg + "#0011")
#define conYellow(_msg) "debug_console" callExtension (_msg + "#1100")
#define conYellowTime(_msg) "debug_console" callExtension (_msg + "#1101")
#define conPurple(_msg) "debug_console" callExtension (_msg + "#1010")
#define conPurpleTime(_msg) "debug_console" callExtension (_msg + "#1011")
#define conCyan(_msg) "debug_console" callExtension (_msg + "#0110")
#define conCyanTime(_msg) "debug_console" callExtension (_msg + "#0111")
#define conFile(_msg) "debug_console" callExtension (_msg + "~0000")
#define conFileTime(_msg) "debug_console" callExtension (_msg + "~0001")
I’ve included this debug_console.hpp file with the .dll inside the .zip. Put this .hpp file next to your init.sqf (or wherever you want really, if you familiar with includes).
//init.sqf
#include "debug_console.hpp"
conBeep(); //makes console beep
conClear(); //clears console screen
conClose(); //closes console, resets logfile filename
conWhite("This Line Is White");
conWhiteTime("This White Line Has Timestamp");
conRed("This Line Is Red");
conRedTime("This Red Line Has Timestamp");
conGreen("This Line Is Green");
conGreenTime("This Green Line Has Timestamp");
conBlue("This Line Is Blue");
conBlueTime("This Blue Line Has Timestamp");
conYellow("This Line Is Yellow");
conYellowTime("This Yellow Line Has Timestamp");
conPurple("This Line Is Purple");
conPurpleTime("This Purple Line Has Timestamp");
conCyan("This Line Is Cyan");
conCyanTime("This Cyan Line Has Timestamp");
conFile("This Line Is Written To Logfile");
conFileTime("This Written To Logfile Line Has Timestamp");
diag_log ("debug_console" callExtension ("i")); //max_output_size
I used init.sqf to demonstrate the use of macros. One thing I have to mention, the macros are case sensitive, so basically type them exactly as you defined them, including the spacing. So conRed(“sometext”); is correct, while conred(“sometext”); or conRed (“sometext”); are not. Also the parameter you pass to macro must be a STRING. And, as you can see, the max_output_size of extension info is back and can be accessed with “i” command (small letter i).
The last 2 lines write into file as well as outputting to console (in grey). To write to file as well as console, change the # to ~ in the print code at the end of the line (see macros definition). The filename is selected automatically when you write to file for the first time and follows the same naming convention as Arma 3 .rpt. There is no limit how much you can write to a file so don’t go crazy on it. To start writing to a new file simply close console with “X” (see macros definition), next file output will go into a new file. There is also no limit on how many files you can create this way, so it is up to you to do the cleaning.
Each output line into file will start from new line. The last digit in the print code determines if the line should have time stamp (see macros definition).
Download debug_console_v3.0
As usual, debug_console.dll should go into Arma X root folder on server (if you are using it on server) and/or on client (if you are using it on client too) . I suggest you go ahead and install Visual C++ Redistributable for Visual Studio 2013 from Microsoft website to make sure it all works. It works even on my WinXP standalone box, so this distribution is pretty good.
Enjoy,
KK