source: nanovis/branches/1.1/Trace.h @ 4874

Last change on this file since 4874 was 4874, checked in by ldelgass, 6 years ago

Add command line options to set I/O file descriptors, merge some refactoring to
prep for merging threading support.

  • Property svn:eol-style set to native
File size: 1.3 KB
RevLine 
[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]22namespace nv {
23
24extern void logUserMessage(const char* format, ...);
25
26extern std::string getUserMessages();
27
28extern void clearUserMessages();
29
30extern void initLog();
31
32extern void closeLog();
33
[3452]34extern 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]50extern bool CheckFBO(GLenum *status);
[1200]51extern void PrintFBOStatus(GLenum status, const char *prefix);
52extern bool CheckGL(const char *prefix);
[4874]53
[848]54#endif
Note: See TracBrowser for help on using the repository browser.