master - ccs: move to the new logsys init API

Fabio M. Di Nitto fabbione@fedoraproject.org
Mon Aug 4 21:49:00 GMT 2008


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0ca6a6a2dda71909275738d929dd72306d3039c3
Commit:        0ca6a6a2dda71909275738d929dd72306d3039c3
Parent:        87f7e54e6b463275cbc663698e8af060ebc8ebf8
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Mon Aug 4 15:57:26 2008 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Mon Aug 4 15:57:26 2008 +0200

ccs: move to the new logsys init API

Change ccs daemon to use the new logsys API.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 ccs/daemon/ccsd.c        |   10 +++-------
 ccs/daemon/cluster_mgr.c |    2 --
 ccs/daemon/cnx_mgr.c     |    2 --
 ccs/daemon/misc.c        |    2 --
 4 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/ccs/daemon/ccsd.c b/ccs/daemon/ccsd.c
index 89e9e5e..ee5e02d 100644
--- a/ccs/daemon/ccsd.c
+++ b/ccs/daemon/ccsd.c
@@ -41,13 +41,6 @@ static int join_group(int sfd, int loopback, int port);
 static int setup_local_socket(int backlog);
 static inline void process_signals(void);
 
-LOGSYS_DECLARE_SYSTEM (NULL,
-	LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_OUTPUT_FILE | LOG_MODE_BUFFER_BEFORE_CONFIG,
-	LOGDIR "/ccs.log",
-	SYSLOGFACILITY);
-
-LOGSYS_DECLARE_SUBSYS ("CCS", SYSLOGLEVEL);
-
 int main(int argc, char *argv[]){
   int i,error=0;
   int trueint = 1;
@@ -60,6 +53,8 @@ int main(int argc, char *argv[]){
   char *msg;
   unsigned int logmode;
 
+  logsys_init("CCS", LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_OUTPUT_FILE | LOG_MODE_FILTER_DEBUG_FROM_SYSLOG | LOG_MODE_BUFFER_BEFORE_CONFIG, SYSLOGFACILITY, SYSLOGLEVEL, LOGDIR "/ccs.log");
+
   msg = parse_cli_args(argc, argv);
 
   if(getenv("CCS_DEBUGLOG"))
@@ -259,6 +254,7 @@ int main(int argc, char *argv[]){
       }
     }
   }
+  logsys_exit();
   exit(EXIT_SUCCESS);
 }
 
diff --git a/ccs/daemon/cluster_mgr.c b/ccs/daemon/cluster_mgr.c
index d8c06c7..46779b7 100644
--- a/ccs/daemon/cluster_mgr.c
+++ b/ccs/daemon/cluster_mgr.c
@@ -37,8 +37,6 @@ static int select_retry(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *xfds,
 
 static ssize_t read_retry(int fd, void *buf, int count, struct timeval *timeout);
 
-LOGSYS_DECLARE_SUBSYS ("CCS", LOG_INFO);
-
 static int check_update_doc(xmlDocPtr tmp_doc)
 {
   int error = 0;
diff --git a/ccs/daemon/cnx_mgr.c b/ccs/daemon/cnx_mgr.c
index 0c04082..21b7ff6 100644
--- a/ccs/daemon/cnx_mgr.c
+++ b/ccs/daemon/cnx_mgr.c
@@ -54,8 +54,6 @@ typedef struct open_connection_s {
   time_t oc_expire;
 } open_connection_t;
 
-LOGSYS_DECLARE_SUBSYS ("CCS", LOG_INFO);
-
 /* ATTENTION: need to lock on this if we start forking the daemon **
 **  Also would need to create a shared memory area for open cnx's */
 static open_connection_t **ocs = NULL;
diff --git a/ccs/daemon/misc.c b/ccs/daemon/misc.c
index 0a9cb07..168944b 100644
--- a/ccs/daemon/misc.c
+++ b/ccs/daemon/misc.c
@@ -29,8 +29,6 @@ pthread_mutex_t update_lock;
 
 open_doc_t *master_doc = NULL;
 
-LOGSYS_DECLARE_SUBSYS ("CCS", LOG_INFO);
-
 /**
  * do_simple_xml_query
  * @ctx: xml context



More information about the Cluster-cvs mailing list