[2798] | 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
[3452] | 2 | /* |
---|
| 3 | * Copyright (C) 2004-2013 HUBzero Foundation, LLC |
---|
| 4 | * |
---|
| 5 | * Author: George A. Howlett <gah@purdue.edu> |
---|
| 6 | */ |
---|
| 7 | |
---|
[848] | 8 | #ifndef __TRACE_H__ |
---|
| 9 | #define __TRACE_H__ |
---|
| 10 | |
---|
[1199] | 11 | #include <GL/glew.h> |
---|
[1991] | 12 | #include <syslog.h> |
---|
[1199] | 13 | |
---|
[2841] | 14 | #include "config.h" |
---|
| 15 | |
---|
[1429] | 16 | #define MAKE_STRING(x) #x |
---|
| 17 | #define NEWSTRING(x) MAKE_STRING(x) |
---|
| 18 | #define AT __FILE__ ":" NEWSTRING(__LINE__) |
---|
| 19 | |
---|
[3605] | 20 | namespace nv { |
---|
| 21 | |
---|
| 22 | extern void logUserMessage(const char* format, ...); |
---|
| 23 | |
---|
| 24 | extern const char *getUserMessages(); |
---|
| 25 | |
---|
| 26 | extern void clearUserMessages(); |
---|
| 27 | |
---|
| 28 | extern void initLog(); |
---|
| 29 | |
---|
| 30 | extern void closeLog(); |
---|
| 31 | |
---|
[3452] | 32 | extern void LogMessage(int priority, const char *funcname, const char *fileName, |
---|
| 33 | int lineNum, const char* format, ...); |
---|
[1984] | 34 | |
---|
[3605] | 35 | #define ERROR(...) nv::LogMessage(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
[1984] | 36 | #ifdef WANT_TRACE |
---|
[3605] | 37 | #define TRACE(...) nv::LogMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
[1984] | 38 | #else |
---|
| 39 | #define TRACE(...) |
---|
| 40 | #endif |
---|
[3605] | 41 | #define WARN(...) nv::LogMessage(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
| 42 | #define INFO(...) nv::LogMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
[1984] | 43 | |
---|
[3605] | 44 | #define USER_ERROR(...) nv::logUserMessage(__VA_ARGS__) |
---|
| 45 | |
---|
| 46 | } |
---|
| 47 | |
---|
[3597] | 48 | extern bool CheckFBO(GLenum *status); |
---|
[1200] | 49 | extern void PrintFBOStatus(GLenum status, const char *prefix); |
---|
| 50 | extern bool CheckGL(const char *prefix); |
---|
[3605] | 51 | |
---|
[848] | 52 | #endif |
---|