aboutsummaryrefslogtreecommitdiffstats
path: root/CommonLibs/Logger.h
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-02-20 17:52:28 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-02-20 20:32:21 +0100
commit11d50d950cccfe8bdc6c3f4a19dcda8661fc80bf (patch)
treede86122c22a7bf0750615a46b512584c537684be /CommonLibs/Logger.h
parent8bd111c942d0d8d2c65369db8f2623eadef54c1e (diff)
Logger: Drop syslog support
This feature is currently not being used, so let's drop it to make it easier to integrate into libosmocore logging system in the future. Change-Id: I8282745ef0282d41599eaf94fe460a1d29b18e2a
Diffstat (limited to 'CommonLibs/Logger.h')
-rw-r--r--CommonLibs/Logger.h31
1 files changed, 11 insertions, 20 deletions
diff --git a/CommonLibs/Logger.h b/CommonLibs/Logger.h
index 7b208fa..e979284 100644
--- a/CommonLibs/Logger.h
+++ b/CommonLibs/Logger.h
@@ -32,7 +32,6 @@
#ifndef LOGGER_H
#define LOGGER_H
-#include <syslog.h>
#include <stdint.h>
#include <stdio.h>
#include <sstream>
@@ -42,6 +41,15 @@
extern int config_log_level;
+#define LOG_EMERG 0 /* system is unusable */
+#define LOG_ALERT 1 /* action must be taken immediately */
+#define LOG_CRIT 2 /* critical conditions */
+#define LOG_ERR 3 /* error conditions */
+#define LOG_WARNING 4 /* warning conditions */
+#define LOG_NOTICE 5 /* normal but significant condition */
+#define LOG_INFO 6 /* informational */
+#define LOG_DEBUG 7 /* debug-level messages */
+
#define _LOG(level) \
Log(LOG_##level).get() << pthread_self() \
<< timestr() << " " __FILE__ ":" << __LINE__ << ":" << __FUNCTION__ << ": "
@@ -56,23 +64,10 @@ extern int config_log_level;
if (IS_LOG_LEVEL(wLevel)) _LOG(wLevel)
#endif
-// pat: And for your edification here are the 'levels' as defined in syslog.h:
-// LOG_EMERG 0 system is unusable
-// LOG_ALERT 1 action must be taken immediately
-// LOG_CRIT 2 critical conditions
-// LOG_ERR 3 error conditions
-// LOG_WARNING 4 warning conditions
-// LOG_NOTICE 5 normal, but significant, condition
-// LOG_INFO 6 informational message
-// LOG_DEBUG 7 debug-level message
-
-
#include "Threads.h" // must be after defines above, if these files are to be allowed to use LOG()
/**
A C++ stream-based thread-safe logger.
- Derived from Dr. Dobb's Sept. 2007 issue.
- Updated to use syslog.
This object is NOT the global logger;
every log record is an object of this class.
*/
@@ -84,16 +79,13 @@ class Log {
std::ostringstream mStream; ///< This is where we buffer up the log entry.
int mPriority; ///< Priority of current report.
- bool mDummyInit;
public:
Log(int wPriority)
- :mPriority(wPriority), mDummyInit(false)
+ :mPriority(wPriority)
{ }
- Log(const char* name, const char* level=NULL, int facility=LOG_USER);
-
// Most of the work is in the destructor.
/** The destructor actually generates the log entry. */
~Log();
@@ -101,7 +93,6 @@ class Log {
std::ostringstream& get();
};
extern bool gLogToConsole; // Output log messages to stdout
-extern bool gLogToSyslog; // Output log messages to syslog
const std::string timestr(); // A timestamp to print in messages.
std::ostream& operator<<(std::ostream& os, std::ostringstream& ss);
@@ -109,7 +100,7 @@ std::ostream& operator<<(std::ostream& os, std::ostringstream& ss);
/**@ Global control and initialization of the logging system. */
//@{
/** Initialize the global logging system. */
-void gLogInit(const char* name, const char* level=NULL, int facility=LOG_USER, char* fn=NULL);
+void gLogInit(const char* level=NULL, char* fn=NULL);
//@}