[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 | |
---|
[4874] | 11 | #include <string> |
---|
| 12 | |
---|
[1199] | 13 | #include <GL/glew.h> |
---|
[1991] | 14 | #include <syslog.h> |
---|
[1199] | 15 | |
---|
[2841] | 16 | #include "config.h" |
---|
| 17 | |
---|
[1429] | 18 | #define MAKE_STRING(x) #x |
---|
| 19 | #define NEWSTRING(x) MAKE_STRING(x) |
---|
| 20 | #define AT __FILE__ ":" NEWSTRING(__LINE__) |
---|
| 21 | |
---|
[4874] | 22 | namespace nv { |
---|
| 23 | |
---|
| 24 | extern void logUserMessage(const char* format, ...); |
---|
| 25 | |
---|
| 26 | extern std::string getUserMessages(); |
---|
| 27 | |
---|
| 28 | extern void clearUserMessages(); |
---|
| 29 | |
---|
| 30 | extern void initLog(); |
---|
| 31 | |
---|
| 32 | extern void closeLog(); |
---|
| 33 | |
---|
[3452] | 34 | extern void LogMessage(int priority, const char *funcname, const char *fileName, |
---|
| 35 | int lineNum, const char* format, ...); |
---|
[1984] | 36 | |
---|
[4874] | 37 | #define ERROR(...) nv::LogMessage(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
[1984] | 38 | #ifdef WANT_TRACE |
---|
[4874] | 39 | #define TRACE(...) nv::LogMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
[1984] | 40 | #else |
---|
| 41 | #define TRACE(...) |
---|
| 42 | #endif |
---|
[4874] | 43 | #define WARN(...) nv::LogMessage(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
| 44 | #define INFO(...) nv::LogMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
[1984] | 45 | |
---|
[4874] | 46 | #define USER_ERROR(...) nv::logUserMessage(__VA_ARGS__); |
---|
| 47 | |
---|
| 48 | } |
---|
| 49 | |
---|
[4612] | 50 | extern bool CheckFBO(GLenum *status); |
---|
[1200] | 51 | extern void PrintFBOStatus(GLenum status, const char *prefix); |
---|
| 52 | extern bool CheckGL(const char *prefix); |
---|
[4874] | 53 | |
---|
[848] | 54 | #endif |
---|