]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Have log print thread pid (avvdr)
authorChris Tallon <chris@vomp.tv>
Wed, 21 Mar 2007 21:12:14 +0000 (21:12 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 21 Mar 2007 21:12:14 +0000 (21:12 +0000)
log.cc
log.h

diff --git a/log.cc b/log.cc
index 884769fc6f4683b20ee38a36abdb1f428d6f07ea..31ebddfc4a2bdb8c4fe800efc5f05d9a0b367ba7 100644 (file)
--- a/log.cc
+++ b/log.cc
@@ -124,7 +124,7 @@ int Log::log(char *fromModule, int level, char* message, ...)
   if (level == INFO)    strcpy(levelString, "[info]  ");
   if (level == DEBUG)   strcpy(levelString, "[debug] ");
 
-  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %s - ", levelString, fromModule);
+  spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %d %s - ", levelString, getpid(), fromModule);
 
   va_list ap;
   va_start(ap, message);
diff --git a/log.h b/log.h
index 0b5c197bed65e4ef3b95b0a7cfea1413a668c213..66a210dba87f0609398aebf32853594c695b1964 100644 (file)
--- a/log.h
+++ b/log.h
@@ -32,6 +32,8 @@
 #include <time.h>
 #include <string.h>
 #include <stdarg.h>
+#include <sys/types.h>
+#include <unistd.h>
 #include "defines.h"
 
 class Log