Changeset 3605 for trunk/packages/vizservers/nanovis/Trace.cpp
- Timestamp:
- Apr 2, 2013, 1:31:30 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Trace.cpp
r3597 r3605 10 10 #include <string.h> 11 11 12 #include <string> 13 #include <sstream> 14 12 15 #include <GL/glew.h> 13 16 … … 15 18 #include "Trace.h" 16 19 20 using namespace nv; 21 22 static std::ostringstream g_UserErrorString; 23 17 24 #define MSG_LEN 2047 18 25 26 /** 27 * \brief Open syslog for writing 28 */ 29 void 30 nv::initLog() 31 { 32 openlog("nanovis", LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER); 33 } 34 35 /** 36 * \brief Close syslog 37 */ 38 void 39 nv::closeLog() 40 { 41 closelog(); 42 } 43 44 /** 45 * \brief Write a message to syslog 46 */ 19 47 void 20 LogMessage(int priority, const char *funcname,21 const char *path, int lineNum, const char* fmt, ...)48 nv::LogMessage(int priority, const char *funcname, 49 const char *path, int lineNum, const char* fmt, ...) 22 50 { 23 51 char message[MSG_LEN+1]; … … 42 70 43 71 syslog(priority, "%s", message); 72 } 73 74 /** 75 * \brief Write a user message to buffer 76 */ 77 void 78 nv::logUserMessage(const char* fmt, ...) 79 { 80 char message[MSG_LEN + 1]; 81 int length = 0; 82 va_list lst; 83 84 va_start(lst, fmt); 85 86 length += vsnprintf(message, MSG_LEN, fmt, lst); 87 message[MSG_LEN] = '\0'; 88 89 g_UserErrorString << message << "\n"; 90 } 91 92 const char * 93 nv::getUserMessages() 94 { 95 return g_UserErrorString.str().c_str(); 96 } 97 98 void 99 nv::clearUserMessages() 100 { 101 g_UserErrorString.str(std::string()); 44 102 } 45 103 … … 116 174 return false; 117 175 } 118 119
Note: See TracChangeset
for help on using the changeset viewer.