summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/logging.h
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/logging.h')
-rw-r--r--libglusterfs/src/logging.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index 53eb5b722..cc806a767 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
+#include <pthread.h>
#ifdef GF_DARWIN_HOST_OS
#define GF_PRI_FSBLK "u"
@@ -34,6 +35,7 @@
#define GF_PRI_BLKSIZE PRId32
#define GF_PRI_SIZET "zu"
+
#if 0
/* Syslog definitions :-) */
#define LOG_EMERG 0 /* system is unusable */
@@ -59,6 +61,9 @@ typedef enum {
GF_LOG_TRACE, /* full trace of operation */
} gf_loglevel_t;
+#define DEFAULT_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
+#define DEFAULT_LOG_LEVEL GF_LOG_INFO
+
typedef struct gf_log_handle_ {
pthread_mutex_t logfile_mutex;
uint8_t logrotate;
@@ -71,11 +76,15 @@ typedef struct gf_log_handle_ {
FILE *gf_log_logfile;
char *cmd_log_filename;
FILE *cmdlogfile;
+#ifdef GF_USE_SYSLOG
+ int log_control_file_found;
+ char *ident;
+#endif /* GF_USE_SYSLOG */
} gf_log_handle_t;
void gf_log_globals_init (void *ctx);
-int gf_log_init (void *data, const char *filename);
+int gf_log_init (void *data, const char *filename, const char *ident);
void gf_log_logrotate (int signum);
@@ -108,7 +117,7 @@ int _gf_log_eh (const char *function, const char *fmt, ...);
#define gf_log_eh(fmt...) do { \
FMT_WARN (fmt); \
- _gf_log_eh (__FUNTION__, ##fmt); \
+ _gf_log_eh (__FUNCTION__, ##fmt); \
} while (0)
#define gf_log_callingfn(dom, levl, fmt...) do { \