![]() |
Gamedev Framework (gf)
0.19.0
A C++17 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... | |
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 | debug (const char *fmt,...) |
Print a debug message. More... | |
static void | info (const char *fmt,...) |
Print an info message. More... | |
static void | warning (const char *fmt,...) |
Print a warning message. More... | |
static void | error (const char *fmt,...) |
Print an error message. More... | |
static void | fatal (const char *fmt,...) |
Print a fatal message and quit. 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. The severity level indicates the severity of the message and range from a simple debug message to a fatal message.
You can set the minimum severity for which messages are displayed. By default, the minimum severity level is gf::Log::Warning (or gf::Log::Debug if debug mode is activated at build time).
Example:
enum gf::Log::Level : int |
|
delete |
Deleted constructor.
|
inlinestatic |
Print a debug message.
fmt | The format string |
|
inlinestatic |
Print an error message.
fmt | The format string |
|
inlinestatic |
Print a fatal message and quit.
fmt | The format string |
|
inlinestatic |
Print an info message.
fmt | The format string |
|
static |
Set a global severity level.
level | The severity level |
|
inlinestatic |
Print a warning message.
fmt | The format string |