Changeset 3452 for trunk/packages/vizservers/nanovis/Trace.cpp
- Timestamp:
- Mar 4, 2013 8:57:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Trace.cpp
r2831 r3452 1 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 */ 2 7 #include <stdio.h> 3 8 #include <stdarg.h> … … 9 14 #include "Trace.h" 10 15 11 static const char *syslogLevels[] = { 12 "emergency", /* System is unusable */ 13 "alert", /* Action must be taken immediately */ 14 "critical", /* Critical conditions */ 15 "error", /* Error conditions */ 16 "warning", /* Warning conditions */ 17 "notice", /* Normal but significant condition */ 18 "info", /* Informational */ 19 "debug", /* Debug-level messages */ 20 }; 16 #define MSG_LEN 2047 21 17 22 18 void 23 LogMessage(int priority, const char *path, int lineNum, const char* fmt, ...) 19 LogMessage(int priority, const char *funcname, 20 const char *path, int lineNum, const char* fmt, ...) 24 21 { 25 #define MSG_LEN (2047)26 22 char message[MSG_LEN+1]; 27 23 const char *s; … … 36 32 s++; 37 33 } 38 length = snprintf(message, MSG_LEN, "%s: %s:%d ", 39 syslogLevels[priority], s, lineNum); 34 if (priority & LOG_DEBUG) { 35 length = snprintf(message, MSG_LEN, "%s:%d(%s): ", s, lineNum, funcname); 36 } else { 37 length = snprintf(message, MSG_LEN, "%s:%d: ", s, lineNum); 38 } 40 39 length += vsnprintf(message + length, MSG_LEN - length, fmt, lst); 41 40 message[MSG_LEN] = '\0'; 42 syslog(priority, message, length); 41 42 syslog(priority, "%s", message); 43 43 } 44 44 … … 72 72 mesg = "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT"; break; 73 73 default: 74 TRACE("FB Status: %s: UNKNOWN framebuffer status %u \n",74 TRACE("FB Status: %s: UNKNOWN framebuffer status %u", 75 75 prefix, (unsigned int)status); 76 76 return; 77 77 } 78 TRACE("FB Status: %s: %s \n", prefix, mesg);78 TRACE("FB Status: %s: %s", prefix, mesg); 79 79 } 80 80 … … 102 102 mesg = "GL_INVALID_FRAMEBUFFER_OPERATION_EXT"; break; 103 103 default: 104 TRACE("GL Status: %s: Unknown status %d \n", prefix, status);104 TRACE("GL Status: %s: Unknown status %d", prefix, status); 105 105 return false; 106 106 } 107 TRACE("GL Status: %s: %s \n", prefix, mesg);107 TRACE("GL Status: %s: %s", prefix, mesg); 108 108 return false; 109 109 }
Note: See TracChangeset
for help on using the changeset viewer.