Browse Source
Merge pull request #1208 from trapexit/syslog
Simplify syslog wrapper a bit
pull/1212/head
trapexit
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
17 deletions
-
libfuse/lib/syslog.c
-
src/syslog.cpp
|
|
@ -21,8 +21,6 @@ |
|
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
|
|
|
|
static bool g_SYSLOG_ENABLED = false; |
|
|
|
|
|
|
|
void |
|
|
|
syslog_open() |
|
|
|
{ |
|
|
@ -31,14 +29,12 @@ syslog_open() |
|
|
|
const int facility = LOG_USER; |
|
|
|
|
|
|
|
openlog(ident,option,facility); |
|
|
|
g_SYSLOG_ENABLED = true; |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|
syslog_close() |
|
|
|
{ |
|
|
|
closelog(); |
|
|
|
g_SYSLOG_ENABLED = false; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
@ -47,9 +43,6 @@ syslog_vlog(const int priority_, |
|
|
|
const char *format_, |
|
|
|
va_list valist_) |
|
|
|
{ |
|
|
|
if(g_SYSLOG_ENABLED == false) |
|
|
|
return; |
|
|
|
|
|
|
|
vsyslog(priority_,format_,valist_); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -19,7 +19,6 @@ |
|
|
|
#include <stdarg.h>
|
|
|
|
#include <syslog.h>
|
|
|
|
|
|
|
|
static bool g_SYSLOG_ENABLED = false; |
|
|
|
|
|
|
|
void |
|
|
|
syslog_open() |
|
|
@ -29,14 +28,12 @@ syslog_open() |
|
|
|
const int facility = LOG_USER; |
|
|
|
|
|
|
|
openlog(ident,option,facility); |
|
|
|
g_SYSLOG_ENABLED = true; |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|
syslog_close() |
|
|
|
{ |
|
|
|
closelog(); |
|
|
|
g_SYSLOG_ENABLED = false; |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
@ -44,9 +41,6 @@ syslog_log(const int priority_, |
|
|
|
const char *format_, |
|
|
|
va_list valist_) |
|
|
|
{ |
|
|
|
if(g_SYSLOG_ENABLED == false) |
|
|
|
return; |
|
|
|
|
|
|
|
vsyslog(priority_,format_,valist_); |
|
|
|
} |
|
|
|
|
|
|
|