Module: sems
Branch: master
Commit: 36cdb3ec3b0a89469a5374deb114f50541e52328
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=36cdb3ec3b0a89469a5374deb114f50541e52328

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Fri Jul 16 00:30:55 2010 +0200

fix di_log example to match new log hook api

---

 apps/examples/di_log/DILog.cpp |    7 +++++--
 apps/examples/di_log/DILog.h   |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/apps/examples/di_log/DILog.cpp b/apps/examples/di_log/DILog.cpp
index 97a9a50..80a581a 100644
--- a/apps/examples/di_log/DILog.cpp
+++ b/apps/examples/di_log/DILog.cpp
@@ -12,6 +12,7 @@
 using namespace std;
 
 #define MOD_NAME "di_log"
+#include "log.h"
 
 EXPORT_LOG_FACILITY_FACTORY(DILog, MOD_NAME);
 EXPORT_PLUGIN_CLASS_FACTORY(DILog, MOD_NAME);
@@ -70,8 +71,10 @@ string DILog::dumpLog() {
   return log.str();
 }
 
-void DILog::log(int level, const char* fmt) {
-  strncpy(ring_buf[pos], fmt, sizeof(ring_buf[0]));
+void DILog::log(int level, pid_t pid, pthread_t tid, 
+               const char* func, const char* file, int line, char* msg) {
+  strncpy(ring_buf[pos], msg, sizeof(ring_buf[0]));
   pos = (pos + 1) % MAX_LINES;
 }
+
 // todo: new() array on load, provide DI for resizing
diff --git a/apps/examples/di_log/DILog.h b/apps/examples/di_log/DILog.h
index 0874014..fc765fd 100644
--- a/apps/examples/di_log/DILog.h
+++ b/apps/examples/di_log/DILog.h
@@ -27,5 +27,6 @@ class DILog : public AmLoggingFacility, public AmDynInvoke, 
public AmDynInvokeFa
   int onLoad();
 
   // LF API
-  void log(int level, const char* fmt);
+  //void log(int level, const char* fmt);
+  void log(int level, pid_t pid, pthread_t tid, const char* func, const char* 
file, int line, char* msg);
 };

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to