diff --git a/apps/examples/di_log/DILog.cpp b/apps/examples/di_log/DILog.cpp index 97a9a506..80a581ab 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 0874014e..fc765fd8 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); };