1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (C) 2004-2013 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | * Author: George A. Howlett <gah@purdue.edu> |
---|
6 | */ |
---|
7 | |
---|
8 | #ifndef NV_TRACE_H |
---|
9 | #define NV_TRACE_H |
---|
10 | |
---|
11 | #include <string> |
---|
12 | |
---|
13 | #include <GL/glew.h> |
---|
14 | #include <syslog.h> |
---|
15 | |
---|
16 | #include "config.h" |
---|
17 | |
---|
18 | #define MAKE_STRING(x) #x |
---|
19 | #define NEWSTRING(x) MAKE_STRING(x) |
---|
20 | #define AT __FILE__ ":" NEWSTRING(__LINE__) |
---|
21 | |
---|
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 | |
---|
34 | extern void LogMessage(int priority, const char *funcname, const char *fileName, |
---|
35 | int lineNum, const char* format, ...); |
---|
36 | |
---|
37 | #define ERROR(...) nv::LogMessage(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
38 | #ifdef WANT_TRACE |
---|
39 | #define TRACE(...) nv::LogMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
40 | #else |
---|
41 | #define TRACE(...) |
---|
42 | #endif |
---|
43 | #define WARN(...) nv::LogMessage(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
44 | #define INFO(...) nv::LogMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) |
---|
45 | |
---|
46 | #define USER_ERROR(...) nv::logUserMessage(__VA_ARGS__) |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | extern bool CheckFBO(GLenum *status); |
---|
51 | extern void PrintFBOStatus(GLenum status, const char *prefix); |
---|
52 | extern bool CheckGL(const char *prefix); |
---|
53 | |
---|
54 | #endif |
---|