Changes between Version 4 and Version 5 of Logging
- Timestamp:
- Jan 22, 2015, 10:56:48 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Logging
v4 v5 7 7 The engine is written in C++. Prefer the following functions for logging and outputting text: 8 8 9 * `LOGMESSAGE(const wchar_t* format, ...)`10 * `LOGMESSAGERENDER(const wchar_t* format, ...)`9 * `LOGMESSAGE(const char* format, ...)` 10 * `LOGMESSAGERENDER(const char* format, ...)` 11 11 12 12 Use these functions to report possible misconfigurations or errors that can be caused by modding: 13 13 14 * `LOGWARNING(const wchar_t* format, ...)`15 * `LOGERROR(const wchar_t* format, ...)`14 * `LOGWARNING(const char* format, ...)` 15 * `LOGERROR(const char* format, ...)` 16 16 * `debug_printf(const wchar_t* format, ...)` 17 17 18 ||= '''Function''' =||= '''Game console''' =||= '''Rendered message''' =||= '''Main log''' =||= '''Interesting log''' =||= '''std ::out'''* =||= '''std::err''' =||18 ||= '''Function''' =||= '''Game console''' =||= '''Rendered message''' =||= '''Main log''' =||= '''Interesting log''' =||= '''stdout'''* =||= '''stderr''' =|| 19 19 ||`LOGMESSAGE` || N || N || Y || N || N || N || 20 20 ||`LOGMESSAGERENDER` || Y || Y - green text || Y || N || N || N || … … 22 22 ||`LOGERROR` || Y || Y - red text || Y || Y || Y || N || 23 23 ||`debug_printf` || N || N || N || N || Y || N || 24 `*` On Windows, the game writes debug output instead of std ::out. Run the game in a debugger or use [http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx DebugView] to view it.[[BR]]24 `*` On Windows, the game writes debug output instead of stdout. Run the game in a debugger or use [http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx DebugView] to view it.[[BR]] 25 25 26 26 '''Note:''' to use the `LOG*` functions, you must include [source:/ps/trunk/source/ps/CLogger.h ps/CLogger.h].[[BR]] 27 '''Note:''' these functions accept standard printf formatting and arguments , and usewide characters, which requires prefixing string literals with 'L':27 '''Note:''' these functions accept standard printf formatting and arguments. debug_printf uses wide characters, which requires prefixing string literals with 'L': 28 28 {{{ 29 29 #!c++ … … 43 43 * `error(message)` 44 44 45 ||= '''Function''' =||= '''Game console''' =||= '''Rendered message''' =||= '''Main log''' =||= '''Interesting log''' =||= '''std ::out'''* =||= '''std::err''' =||45 ||= '''Function''' =||= '''Game console''' =||= '''Rendered message''' =||= '''Main log''' =||= '''Interesting log''' =||= '''stdout'''* =||= '''stderr''' =|| 46 46 ||`print` || N || N || N || N || Y || N || 47 47 ||`console.write` || Y || N || N || N || N || N || … … 49 49 ||`warn` || Y || Y - yellow text || Y || Y || Y || N || 50 50 ||`error` || Y || Y - red text || Y || Y || Y || N || 51 `*` On Windows, the game writes debug output instead of std ::out. Run the game in a debugger or use [http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx DebugView] to view it.[[BR]]51 `*` On Windows, the game writes debug output instead of stdout. Run the game in a debugger or use [http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx DebugView] to view it.[[BR]]