Xors3d Engine
Logging

Functions

void xClearLogString ()
 Clears log string.
int xCloseLog ()
 Finishes logging.
int xCreateLog (int target=1, int level=0, const char *filename="xors_log.html", const char *cssfilename="")
 Starts logging.
int xGetLogLevel ()
 Returns current logging level.
const char * xGetLogString ()
 Returns string which contains log messages.
int xGetLogTarget ()
 Returns current logging target.
void xLogError (const char *message, const char *func="", const char *file="", int line=-1)
 Adds an Error-styled entry to log system.
void xLogFatal (const char *message, const char *func="", const char *file="", int line=-1)
 Adds a Fatal-styled entry to log system.
void xLogInfo (const char *message, const char *func="", const char *file="", int line=-1)
 Adds a Info-styled entry to log system.
void xLogMessage (const char *message, const char *func="", const char *file="", int line=-1)
 Adds a Message-styled entry to log system.
void xLogWarning (const char *message, const char *func="", const char *file="", int line=-1)
 Adds a Warning-styled entry to log system.
void xSetLogLevel (int level=2)
 Changes logging level.
void xSetLogTarget (int target=1)
 Changes logging target.

Function Documentation

int xCreateLog ( int  target = 1,
int  level = 0,
const char *  filename = "xors_log.html",
const char *  cssfilename = "" 
)

Starts logging.

This function enables engine logging. You can specify logging level, target, html-file and css-file for log output.

Parameters:
targetLogging target. See 'Logging output targets' for more information
levelLogging level. See 'Logging level' for more information
filenameLog file for output (needed if HTML logging is enabled). Existing file will be overwritten!
cssfilenameA path to an external style sheet used by HTML log. A full or relative path is acceptable.
Returns:
Non-zero value indicates an error. -1 if logging is already started. Positive value is equal to errno code.
int xCloseLog ( )

Finishes logging.

This function finishes logging and closes log file (if HTML output was enabled).

Returns:
Non-zero value indicates an error. -1 if logging is already finished or hasn't been started.
const char* xGetLogString ( )

Returns string which contains log messages.

This function returns log meessages written since last xClearLogString() or xGetLogString() call.

See also:
xClearLogString()
void xClearLogString ( )

Clears log string.

Clears string which contains log messages. This command doesn't clear html log-file or standard output stream (std::cout).

See also:
xGetLogString()
void xSetLogLevel ( int  level = 2)

Changes logging level.

Logging level controls types of messages to be written to log. See 'Logging level' for more information about logging levels.

Parameters:
levelLogging level
See also:
xGetLogLevel(), xSetLogTarget()
void xSetLogTarget ( int  target = 1)

Changes logging target.

This function allows you to specify where log messages should be written. See 'Logging output targets' for more information about logging targets.

Parameters:
targetLogging target
See also:
xGetLogTarget(), xSetLogLevel()
int xGetLogLevel ( )

Returns current logging level.

See also:
xSetLogLevel()
int xGetLogTarget ( )

Returns current logging target.

See also:
xSetLogTarget()
void xLogInfo ( const char *  message,
const char *  func = "",
const char *  file = "",
int  line = -1 
)

Adds a Info-styled entry to log system.

This function is useful for making log entries from your own code and watching them along with entries made by Xors3d core.
Func, file and line parameters are displayed in hovering window in HTML format. If func and file are empty and line is -1, the hovering window won't be displayed.

Parameters:
messageThe text of entry to be logged
funcFunction name
fileFile name
lineLine of code
void xLogMessage ( const char *  message,
const char *  func = "",
const char *  file = "",
int  line = -1 
)

Adds a Message-styled entry to log system.

This function is useful for making log entries from your own code and watching them along with entries made by Xors3d core.
Func, file and line parameters are displayed in hovering window in HTML format. If func and file are empty and line is -1, the hovering window won't be displayed.

Parameters:
messageThe text of entry to be logged
funcFunction name
fileFile name
lineLine of code
void xLogWarning ( const char *  message,
const char *  func = "",
const char *  file = "",
int  line = -1 
)

Adds a Warning-styled entry to log system.

This function is useful for making log entries from your own code and watching them along with entries made by Xors3d core.
Func, file and line parameters are displayed in hovering window in HTML format. If func and file are empty and line is -1, the hovering window won't be displayed.

Parameters:
messageThe text of entry to be logged
funcFunction name
fileFile name
lineLine of code
void xLogError ( const char *  message,
const char *  func = "",
const char *  file = "",
int  line = -1 
)

Adds an Error-styled entry to log system.

This function is useful for making log entries from your own code and watching them along with entries made by Xors3d core.
Func, file and line parameters are displayed in hovering window in HTML format. If func and file are empty and line is -1, the hovering window won't be displayed.

Parameters:
messageThe text of entry to be logged
funcFunction name
fileFile name
lineLine of code
void xLogFatal ( const char *  message,
const char *  func = "",
const char *  file = "",
int  line = -1 
)

Adds a Fatal-styled entry to log system.

This function is useful for making log entries from your own code and watching them along with entries made by Xors3d core.
Func, file and line parameters are displayed in hovering window in HTML format. If func and file are empty and line is -1, the hovering window won't be displayed.

Parameters:
messageThe text of entry to be logged
funcFunction name
fileFile name
lineLine of code