Add syslog support.
This commit is contained in:
@@ -22,19 +22,26 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
|
||||
#include "log/SysLog.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
SysLog::SysLog()
|
||||
{
|
||||
openlog(APP_ID, LOG_PID, LOG_USER);
|
||||
}
|
||||
|
||||
|
||||
void SysLog::message(int level, const char* fmt, va_list args)
|
||||
void SysLog::message(int level, const char *fmt, va_list args)
|
||||
{
|
||||
vsyslog(level, fmt, args);
|
||||
}
|
||||
|
||||
|
||||
void SysLog::text(const char* fmt, va_list args)
|
||||
void SysLog::text(const char *fmt, va_list args)
|
||||
{
|
||||
message(LOG_INFO, fmt, args);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __SYSLOG_BACKEND_H__
|
||||
#define __SYSLOG_BACKEND_H__
|
||||
#ifndef __SYSLOG_H__
|
||||
#define __SYSLOG_H__
|
||||
|
||||
|
||||
#include "interfaces/ILogBackend.h"
|
||||
@@ -33,8 +33,8 @@ class SysLog : public ILogBackend
|
||||
public:
|
||||
SysLog();
|
||||
|
||||
void message(int level, const char* fmt, va_list args) override;
|
||||
void text(const char* fmt, va_list args) override;
|
||||
void message(int level, const char *fmt, va_list args) override;
|
||||
void text(const char *fmt, va_list args) override;
|
||||
};
|
||||
|
||||
#endif /* __SYSLOG_BACKEND_H__ */
|
||||
|
||||
Reference in New Issue
Block a user