Changes between Version 4 and Version 5 of Logging


Ignore:
Timestamp:
Jan 22, 2015, 10:56:48 PM (9 years ago)
Author:
Philip Taylor
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Logging

    v4 v5  
    77The engine is written in C++. Prefer the following functions for logging and outputting text:
    88
    9  * `LOGMESSAGE(const wchar_t* format, ...)`
    10  * `LOGMESSAGERENDER(const wchar_t* format, ...)`
     9 * `LOGMESSAGE(const char* format, ...)`
     10 * `LOGMESSAGERENDER(const char* format, ...)`
    1111
    1212Use these functions to report possible misconfigurations or errors that can be caused by modding:
    1313
    14  * `LOGWARNING(const wchar_t* format, ...)`
    15  * `LOGERROR(const wchar_t* format, ...)`
     14 * `LOGWARNING(const char* format, ...)`
     15 * `LOGERROR(const char* format, ...)`
    1616 * `debug_printf(const wchar_t* format, ...)`
    1717
    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''' =||
    1919||`LOGMESSAGE` ||  N  ||  N  ||  Y  ||  N  ||  N  ||  N  ||
    2020||`LOGMESSAGERENDER` ||  Y  ||  Y - green text  ||  Y  ||  N  ||  N  ||  N  ||
     
    2222||`LOGERROR` ||  Y  ||  Y - red text  ||  Y  ||  Y  ||  Y  ||  N  ||
    2323||`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]]
    2525
    2626'''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 use wide 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':
    2828{{{
    2929#!c++
     
    4343 * `error(message)`
    4444
    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''' =||
    4646||`print` ||  N  ||  N  ||  N  ||  N  ||  Y  ||  N  ||
    4747||`console.write` ||  Y  ||  N  ||  N  ||  N  ||  N  ||  N  ||
     
    4949||`warn` ||  Y  ||  Y - yellow text  ||  Y  ||  Y  ||  Y  ||  N  ||
    5050||`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]]