ErrorHandling.rst edited online with Bitbucket: Trying to fix syntax highlighting in user manual.

This commit is contained in:
David Williams 2013-05-16 08:35:00 +00:00
parent 2203e30f39
commit 2010b46709

View File

@ -9,7 +9,7 @@ PolyVox has a simple logging mechanism which allows it to write messages with an
The following functions are called at various points in the PolyVox codebase: The following functions are called at various points in the PolyVox codebase:
.. code-block:: c++ .. code-block :: c++
void logDebug (const std::string& message); void logDebug (const std::string& message);
void logInfo (const std::string& message); void logInfo (const std::string& message);
@ -21,13 +21,13 @@ Fatal messages are only issued in non-recoverable scenarios when the application
PolyVox defines a LogHandler function pointer which looks like this: PolyVox defines a LogHandler function pointer which looks like this:
.. code-block:: c++ .. code-block :: c++
typedef void (*LogHandler)(const std::string& message, LogLevel logLevel); typedef void (*LogHandler)(const std::string& message, LogLevel logLevel);
There is a function called 'defaultLogHandler()' which matches this signature and writes the messages to cout/cerr (note that it suppresses Debug messages). To redirect log messages you can write your own fuction which matches this signature and the apply it with setLogHandler: There is a function called 'defaultLogHandler()' which matches this signature and writes the messages to cout/cerr (note that it suppresses Debug messages). To redirect log messages you can write your own fuction which matches this signature and the apply it with setLogHandler:
.. code-block:: c++ .. code-block :: c++
setLogHandler(&myLogHandler); setLogHandler(&myLogHandler);