source: trunk/packages/vizservers/vtkvis/Trace.h @ 4422

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

Fix crash bug in user errors: was returning pointer to temporary. Return a
copy of string object from getUserMessages instead of pointer.

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2012  HUBzero Foundation, LLC
4 *
5 * Author: George A. Howlett <gah@purdue.edu>
6 */
7
8#ifndef VTKVIS_TRACE_H
9#define VTKVIS_TRACE_H
10
11#include <string>
12
13#include <syslog.h>
14
15namespace VtkVis {
16
17extern void logUserMessage(const char* format, ...);
18
19extern std::string getUserMessages();
20
21extern void clearUserMessages();
22
23extern void initLog();
24
25extern void closeLog();
26
27extern void logMessage(int priority, const char *funcname, const char *fileName,
28                       int lineNum, const char* format, ...);
29
30#define ERROR(...)      VtkVis::logMessage(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
31#ifdef WANT_TRACE
32#define TRACE(...)      VtkVis::logMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
33#else
34#define TRACE(...)
35#endif  /*WANT_TRACE*/
36#define WARN(...)       VtkVis::logMessage(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
37#define INFO(...)       VtkVis::logMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
38
39#define USER_ERROR(...) VtkVis::logUserMessage(__VA_ARGS__)
40
41}
42
43#endif
Note: See TracBrowser for help on using the repository browser.