Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
Logging functions. More...
#include <gf/Log.h>
Public Types | |
enum | Level : int { Debug, Info, Warn, Error, Fatal } |
The severity level of the log. More... | |
enum | Category : int { General, Graphics, Network, Physics, Resources } |
The category of the log. More... | |
Public Member Functions | |
Log ()=delete | |
Deleted constructor. More... | |
Static Public Member Functions | |
static void | setLevel (Level level) |
Set a global severity level. More... | |
static void | setLevel (Category category, Level level) |
Set a severity level for a category. More... | |
static void | debug (Category category, const char *fmt,...) |
Print a debug message. More... | |
static void | info (Category category, const char *fmt,...) |
Print an info message. More... | |
static void | warning (Category category, const char *fmt,...) |
Print a warning message. More... | |
static void | error (Category category, const char *fmt,...) |
Print an error message. More... | |
static void | fatal (Category category, const char *fmt,...) |
Print a fatal message and quit. More... | |
static void | print (const char *fmt,...) |
Print a message without any level or category. More... | |
Logging functions.
Logging functions are used to report some events that have happened in the system. These functions print messages to the standard error. It uses printf
-like format strings.
A message is associated to a severity level and a category. The severity level indicates the severity of the message and range from a simple debug message to a fatal message. The category of the message indicates the origin of the message in the library.
You can set the minimum severity for which messages are displayed either globally or for each category. By default, the minimum severity level is gf::Log::Warning (or gf::Log::Debug if debug mode is activated at build time).
Example:
|
delete |
Deleted constructor.
|
inlinestatic |
Print a debug message.
category | The category |
fmt | The format string |
|
inlinestatic |
Print an error message.
category | The category |
fmt | The format string |
|
inlinestatic |
Print a fatal message and quit.
category | The category |
fmt | The format string |
|
inlinestatic |
Print an info message.
category | The category |
fmt | The format string |
|
static |
Print a message without any level or category.
This function can be used for printing messages during the development.
fmt | The format string |
|
static |
Set a global severity level.
level | The severity level |
Set a severity level for a category.
category | The category |
level | The severity level |
|
inlinestatic |
Print a warning message.
category | The category |
fmt | The format string |