aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs/Logger.cpp
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-12-16 06:08:18 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-12-16 06:08:18 +0000
commit00913d74d9d3d9e270a5624513adc3939b257ff1 (patch)
tree679554be25614c9fc9aff1741f8840d843f0d90e /CommonLibs/Logger.cpp
parentdb70eb4c6e3837e0561be36fcc612f65722e037b (diff)
Sylvain patch #2, with modifications:
CommonLibs: Avoid direct syslog calls in ConfigurationTable We instead introduce a 'log early' facility in Logger.h to accomplish the same Signed-off-by: Sylvain Munaut <tnt@246tNt.com> I added similar code to the reporting functions, which did not exist when sylvain made this patch git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4629 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'CommonLibs/Logger.cpp')
-rw-r--r--CommonLibs/Logger.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp
index d8bfc6e..36b7696 100644
--- a/CommonLibs/Logger.cpp
+++ b/CommonLibs/Logger.cpp
@@ -28,6 +28,7 @@
#include <cstdio>
#include <fstream>
#include <string>
+#include <stdarg.h>
#include "Configuration.h"
#include "Logger.h"
@@ -200,6 +201,13 @@ void gLogInit(const char* name, const char* level, int facility)
}
-
+void gLogEarly(int level, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ vsyslog(level | LOG_USER, fmt, args);
+ va_end(args);
+}
// vim: ts=4 sw=4