Skip to content
tiffany352 edited this page Aug 9, 2012 · 3 revisions

Sypnosis

#include "common/log.h"

FILE *il_Common_logfile; il_Common_loglevel_tostring(level); il_Common_log(level, format, ...);

Description

This file describes logging facilities in IntenseLogic. You should use these instead of printf() or other functions.

The log macro takes a level to log at, a format string, and arguments for the format. It will either print its arguments (formatted to have line number + file + loglevel information) to the logfile if the level argument is less than or equal to the current logging level, or it will do nothing.

The loglevel_tostring macro takes a logging level, and returns a string representation of it.

The log levels are an enum as follows:

  • IL_COMMON_LOGFATAL - A fatal error has occurred and the engine will be shut down after you have logged this. (The log function will not initialise the shutdown, you have to do that yourself.)
  • IL_COMMON_LOGERROR - An error has occurred that requires the current function to exit unexpectedly.
  • IL_COMMON_LOGWARNING - An error has occurred that should be noted but does not require have any effects on the operation of the engine.
  • IL_COMMON_LOGNOTICE - A notification of something that has occurred in the engine (for example, disconnected from a server or finished loading a map).
  • IL_COMMON_LOGDEBUG - Debug information that is of no use to the user whatsoever, and should only be enabled to help weed out bugs.
  • IL_COMMON_LOGFLOOD - Flood debug information that will probably be printed at least once per second on average, and should only be used in an extreme case where there is an issue that is very difficult to locate.

See Also

Clone this wiki locally