Create Project for repo.or.cz
[vp.git] / src / mfc / SsbSipLogMsg.cpp
blobc582a016ffe6eebeaf786b17bfbfd8ffd3720594
1 #include <stdarg.h>
2 #include <string.h>
3 #include <stdio.h>
4 #include "SsbSipLogMsg.h"
7 static const LOG_LEVEL log_level = LOG_TRACE;
8 static const char *modulename = MODULE_NAME;
9 static const char *level_str[] = {"TRACE", "WARNING", "ERROR"};
11 void LOG_MSG(LOG_LEVEL level, const char *func_name, const char *msg, ...)
14 char buf[256];
15 va_list argptr;
17 if (level < log_level)
18 return;
20 sprintf(buf, "[%s: %s] %s: ", modulename, level_str[level], func_name);
22 va_start(argptr, msg);
23 vsprintf(buf + strlen(buf), msg, argptr);
24 printf(buf);
25 va_end(argptr);