trace utility in logger
This commit is contained in:
parent
77d1ebc8c5
commit
914a76e54a
|
@ -1,4 +1,5 @@
|
|||
#include "graphics.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
@ -22,6 +23,9 @@ void Graphics::init()
|
|||
glEnable(GL_ALPHA_TEST); // enable alpha
|
||||
glAlphaFunc(GL_GREATER, 0.0f); // default alpha mode
|
||||
glDisable(GL_DEPTH_TEST); // we are rendering 2D only, we don't need it
|
||||
|
||||
notice("GPU %s", (const char*)glGetString(GL_RENDERER));
|
||||
notice("OpenGL %s", (const char*)glGetString(GL_VERSION));
|
||||
}
|
||||
|
||||
void Graphics::terminate()
|
||||
|
|
13
src/logger.h
13
src/logger.h
|
@ -13,10 +13,13 @@ enum ELogLevel {
|
|||
|
||||
void _log(int level, const char *trace, const char *format, ...);
|
||||
|
||||
#define fatal(...) _log(LFATAL, NULL, ## __VA_ARGS__)
|
||||
#define error(...) _log(LERROR, NULL, ## __VA_ARGS__)
|
||||
#define warning(...) _log(LWARNING, NULL, ## __VA_ARGS__)
|
||||
#define debug(...) _log(LDEBUG, NULL, ## __VA_ARGS__)
|
||||
#define notice(...) _log(LNOTICE, NULL, ## __VA_ARGS__)
|
||||
#define fatal(...) _log(LFATAL, NULL, __VA_ARGS__)
|
||||
#define error(...) _log(LERROR, NULL, __VA_ARGS__)
|
||||
#define warning(...) _log(LWARNING, NULL, __VA_ARGS__)
|
||||
#define debug(...) _log(LDEBUG, NULL, __VA_ARGS__)
|
||||
#define notice(...) _log(LNOTICE, NULL, __VA_ARGS__)
|
||||
|
||||
#define trace() _log(LDEBUG, __PRETTY_FUNCTION__, "")
|
||||
#define tdebug(...) _log(LDEBUG, __PRETTY_FUNCTION__, __VA_ARGS__)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
#include "logger.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
|
Loading…
Reference in New Issue