source: trunk/packages/vizservers/nanovis/Trace.h @ 3605

Last change on this file since 3605 was 3605, checked in by ldelgass, 7 years ago

Add writer thread to nanovis (set USE_THREADS in Makefile), more refactoring.

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
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 __TRACE_H__
9#define __TRACE_H__
10
11#include <GL/glew.h>
12#include <syslog.h>
13
14#include "config.h"
15
16#define MAKE_STRING(x) #x
17#define NEWSTRING(x) MAKE_STRING(x)
18#define AT __FILE__ ":" NEWSTRING(__LINE__)
19
20namespace nv {
21
22extern void logUserMessage(const char* format, ...);
23
24extern const char *getUserMessages();
25
26extern void clearUserMessages();
27
28extern void initLog();
29
30extern void closeLog();
31
32extern void LogMessage(int priority, const char *funcname, const char *fileName,
33                       int lineNum, const char* format, ...);
34
35#define ERROR(...)      nv::LogMessage(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
36#ifdef WANT_TRACE
37#define TRACE(...)      nv::LogMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
38#else
39#define TRACE(...)
40#endif
41#define WARN(...)       nv::LogMessage(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
42#define INFO(...)       nv::LogMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
43
44#define USER_ERROR(...) nv::logUserMessage(__VA_ARGS__)
45
46}
47
48extern bool CheckFBO(GLenum *status);
49extern void PrintFBOStatus(GLenum status, const char *prefix);
50extern bool CheckGL(const char *prefix);
51
52#endif
Note: See TracBrowser for help on using the repository browser.