more moving to new logging standard
authorArt Cancro <ajc@citadel.org>
Thu, 30 Mar 2017 21:18:40 +0000 (17:18 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 30 Mar 2017 21:18:40 +0000 (17:18 -0400)
12 files changed:
citadel/context.h
citadel/event_client.h
citadel/modules/c-ares-dns/serv_c-ares-dns.c
citadel/modules/ctdlproto/serv_rooms.c
citadel/modules/ctdlproto/serv_user.c
citadel/modules/eventclient/serv_eventclient.c
citadel/modules/network/serv_netspool.c
citadel/modules/network/serv_network.h
citadel/msgbase.h
citadel/scripts/mk_module_init.sh
citadel/serv_extensions.h
citadel/server_main.c

index cde77f496f5b278c5f658a4a5aa60bd82da273aa..755d1998b4b9db062e0305e403cfe06b5930ad40 100644 (file)
@@ -207,18 +207,5 @@ static INLINE void become_session(CitContext *which_con) {
 
 
 
-/* typedef void (*CtdlDbgFunction) (const int); */
-
-extern int DebugSession;
-#define CONDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugSession != 0))
-
-#define CON_syslog(LEVEL, FORMAT, ...)                                 \
-       CONDBGLOG(LEVEL) syslog(LEVEL,                                  \
-                               "%s Context: " FORMAT, IOSTR, __VA_ARGS__)
-
-#define CONM_syslog(LEVEL, FORMAT)                             \
-       CONDBGLOG(LEVEL) syslog(LEVEL,                          \
-                               "%s Context: " FORMAT, IOSTR);
-
 
 #endif /* CONTEXT_H */
index 66976a8aded74ce1fc8aa1a120976007579c26ca..2b5b698bd5b936f5572a57c977f0322968ffe521 100644 (file)
@@ -232,24 +232,6 @@ extern int DebugCAres;
 
 #define CCID ((CitContext*)IO->CitContext)?((CitContext*)IO->CitContext)->cs_pid:-1
 
-#define EVQ_syslog(LEVEL, FORMAT, ...)                                 \
-       EDBGLOG (LEVEL) syslog(LEVEL, "%sQ " FORMAT, IOSTR, __VA_ARGS__)
-
-#define EVQM_syslog(LEVEL, FORMAT)                     \
-       EDBGLOG (LEVEL) syslog(LEVEL, "%s " FORMAT, IOSTR)
-
-#define EV_syslog(LEVEL, FORMAT, ...)                                  \
-       EDBGLOG (LEVEL) syslog(LEVEL, "%s[%ld]CC[%d] " FORMAT, IOSTR, IO->ID, CCID, __VA_ARGS__)
-
-#define EVM_syslog(LEVEL, FORMAT)                                      \
-       EDBGLOG (LEVEL) syslog(LEVEL, "%s[%ld]CC[%d] " FORMAT, IOSTR, IO->ID, CCID)
-
-#define EVNC_syslog(LEVEL, FORMAT, ...)                                        \
-       EDBGLOG (LEVEL) syslog(LEVEL, "%s[%ld] " FORMAT, IOSTR, IO->ID, __VA_ARGS__)
-
-#define EVNCM_syslog(LEVEL, FORMAT) EDBGLOG (LEVEL) syslog(LEVEL, "%s[%ld]" FORMAT, IOSTR, IO->ID)
-
-
 #define CDBGLOG() if (DebugCAres != 0)
 #define CEDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugCAres != 0))
 #define EV_DNS_LOG_START(a)                                                    \
@@ -276,12 +258,6 @@ extern int DebugCAres;
        CDBGLOG () { syslog(LOG_DEBUG, "%s[%ld]CC[%d] * Init " #a " %p", IOSTR, IO->ID, CCID, &IO->a); \
                     EV_backtrace(IO);}
 
-#define EV_DNS_syslog(LEVEL, FORMAT, ...)                              \
-       CEDBGLOG (LEVEL) syslog(LEVEL, "%s[%ld]CC[%d] " FORMAT, IOSTR, IO->ID, CCID, __VA_ARGS__)
-
-#define EVM_DNS_syslog(LEVEL, FORMAT)                                  \
-       CEDBGLOG (LEVEL) syslog(LEVEL, "%s[%ld]CC[%d] " FORMAT, IOSTR, IO->ID, CCID)
-
 void FreeAsyncIOContents(AsyncIO *IO);
 
 eNextState NextDBOperation(AsyncIO *IO, IO_CallBack CB);
@@ -322,7 +298,7 @@ void SetNextTimeout(AsyncIO *IO, double timeout);
        do { \
                sta = curl_easy_setopt(chnd, (CURLOPT_##s), (v));       \
                if (sta)  {                                             \
-                       EVQ_syslog(LOG_ERR,                             \
+                       syslog(LOG_ERR,                         \
                               "error setting option " #s               \
                               " on curl handle: %s",                   \
                               curl_easy_strerror(sta));                \
index 99131ae221cd9202d93fa1575721be57a4e9ff92..06f594bf1a6590bc5d696bdf0eea9302a59d0d22 100644 (file)
@@ -1,21 +1,15 @@
 /*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-2017 by the citadel.org team
  *
- *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3.
- *  
- *  
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  
- *  
- *  
- *
- *  Inspired by NodeJS.org; thanks for the MX-Parser ;-)
+ * Inspired by NodeJS.org; thanks for the MX-Parser ;-)
  */
 
 #include "sysdep.h"
@@ -71,7 +65,7 @@ static void HostByAddrCb(void *data,
 {
        AsyncIO *IO = data;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        EV_DNS_LOGT_STOP(DNS.timeout);
        ev_timer_stop (event_base, &IO->DNS.timeout);
@@ -88,7 +82,7 @@ static void ParseAnswerA(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct hostent* host = NULL;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -115,7 +109,7 @@ static void ParseAnswerAAAA(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct hostent* host = NULL;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -142,7 +136,7 @@ static void ParseAnswerCNAME(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct hostent* host = NULL;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -171,7 +165,7 @@ static void ParseAnswerMX(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct ares_mx_reply *mx_out = NULL;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -195,7 +189,7 @@ static void ParseAnswerNS(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct hostent* host = NULL;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -218,7 +212,7 @@ static void ParseAnswerSRV(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct ares_srv_reply *srv_out = NULL;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -242,7 +236,7 @@ static void ParseAnswerTXT(AsyncIO *IO, unsigned char* abuf, int alen)
 {
        struct ares_txt_reply *txt_out;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        if (IO->DNS.Query->VParsedDNSReply != NULL)
                IO->DNS.Query->DNSReplyFree(IO->DNS.Query->VParsedDNSReply);
@@ -269,7 +263,7 @@ void QueryCb(void *arg,
        AsyncIO *IO = arg;
 
        SetEVState(IO, eCaresStart);
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        EV_DNS_LOGT_STOP(DNS.timeout);
        ev_timer_stop (event_base, &IO->DNS.timeout);
@@ -278,9 +272,7 @@ void QueryCb(void *arg,
        if (status == ARES_SUCCESS)
                IO->DNS.Query->DNS_CB(arg, abuf, alen);
        else {
-               EV_DNS_syslog(LOG_DEBUG, "C-ARES: Failed by: %s error %s\n",
-                             __FUNCTION__,
-                             ares_strerror(status));
+               syslog(LOG_DEBUG, "c-ares: Failed by: %s error %s", __FUNCTION__, ares_strerror(status));
                StrBufPrintf(IO->ErrMsg,
                             "%s-lookup %s - %s",
                             IO->DNS.Query->QueryTYPE,
@@ -300,7 +292,7 @@ void QueryCb(void *arg,
 void QueryCbDone(AsyncIO *IO)
 {
        SetEVState(IO, eCaresDoneIO);
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        EV_DNS_LOGT_STOP(DNS.timeout);
        ev_timer_stop (event_base, &IO->DNS.timeout);
@@ -312,18 +304,14 @@ void QueryCbDone(AsyncIO *IO)
 void DestructCAres(AsyncIO *IO)
 {
        SetEVState(IO, eCaresX);
-       EVNC_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
-
-       EVNC_syslog(LOG_DEBUG, "C-ARES: - stopping %s %d %p \n", "DNS.recv_event", IO->DNS.recv_event.fd, &IO->DNS.recv_event);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: stopping %s %d %p", "DNS.recv_event", IO->DNS.recv_event.fd, &IO->DNS.recv_event);
        ev_io_stop(event_base, &IO->DNS.recv_event);
-
-       EVNC_syslog(LOG_DEBUG, "C-ARES: - stopping %s %d %p\n", "DNS.send_event", IO->DNS.send_event.fd, &IO->DNS.send_event);
+       syslog(LOG_DEBUG, "c-ares: stopping %s %d %p", "DNS.send_event", IO->DNS.send_event.fd, &IO->DNS.send_event);
        ev_io_stop(event_base, &IO->DNS.send_event);
-
-       EVNC_syslog(LOG_DEBUG, "C-ARES: - stopping %s %p\n", "DNS.timeout", &IO->DNS.send_event);
+       syslog(LOG_DEBUG, "c-ares: stopping %s %p", "DNS.timeout", &IO->DNS.send_event);
        ev_timer_stop (event_base, &IO->DNS.timeout);
-
-       EVNC_syslog(LOG_DEBUG, "C-ARES: - stopping %s %p\n", "DNS.unwind_stack", &IO->unwind_stack);
+       syslog(LOG_DEBUG, "c-ares: stopping %s %p", "DNS.unwind_stack", &IO->unwind_stack);
        ev_idle_stop(event_base, &IO->unwind_stack);
        ares_destroy_options(&IO->DNS.Options);
 }
@@ -333,7 +321,7 @@ void InitC_ares_dns(AsyncIO *IO)
 {
        int optmask = 0;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s %p\n", __FUNCTION__, IO->DNS.Channel);
+       syslog(LOG_DEBUG, "c-ares: %s %p", __FUNCTION__, IO->DNS.Channel);
 
        if (IO->DNS.Channel == NULL) {
                optmask |= ARES_OPT_SOCK_STATE_CB;
@@ -360,7 +348,7 @@ DNStimeouttrigger_callback(struct ev_loop *loop, ev_timer *watcher, int revents)
            (NextTV->tv_usec != MaxTV.tv_usec))
        {
                fd_set readers, writers;
-               EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s Timeout!\n", __FUNCTION__);
+               syslog(LOG_DEBUG, "c-ares: %s Timeout!", __FUNCTION__);
 
                FD_ZERO(&readers);
                FD_ZERO(&writers);
@@ -376,7 +364,7 @@ void QueueGetHostByNameDone(void *Ctx,
 {
        AsyncIO *IO = (AsyncIO *) Ctx;
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
 
        IO->DNS.Query->DNSStatus = status;
@@ -401,7 +389,7 @@ void QueueGetHostByName(AsyncIO *IO,
                        IO_CallBack PostDNS)
 {
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
        IO->DNS.SourcePort = 0;
 
        IO->DNS.Query = QueryParts;
@@ -512,16 +500,15 @@ int QueueQuery(ns_type Type,
                EV_DNS_LOGT_START(DNS.timeout);
                ev_timer_start(event_base, &IO->DNS.timeout);
 
-               EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s X1\n", __FUNCTION__);
-
+               syslog(LOG_DEBUG, "c-ares: %s X1", __FUNCTION__);
                return 1;
 
        default:
 
-               EV_DNS_syslog(LOG_DEBUG, "C-ARES: %sX2\n", __FUNCTION__);
+               syslog(LOG_DEBUG, "c-ares: %sX2", __FUNCTION__);
                return 0;
        }
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        ares_query(IO->DNS.Channel, name, ns_c_in, Type, QueryCb, IO);
        EV_DNS_LOGT_START(DNS.timeout);
@@ -542,7 +529,7 @@ static void DNS_send_callback(struct ev_loop *loop, ev_io *watcher, int revents)
 
        IO->Now = ev_now(event_base);
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        ares_process_fd(IO->DNS.Channel,
                        ARES_SOCKET_BAD,
@@ -554,7 +541,7 @@ static void DNS_recv_callback(struct ev_loop *loop, ev_io *watcher, int revents)
 
        IO->Now = ev_now(event_base);
 
-       EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "c-ares: %s", __FUNCTION__);
 
        ares_process_fd(IO->DNS.Channel,
                        IO->DNS.recv_event.fd,
@@ -576,12 +563,7 @@ void SockStateCb(void *data, int sock, int read, int write)
                {
                        IO->DNS.SourcePort = ntohs(sin.sin_port);
                }
-               EV_DNS_syslog(LOG_DEBUG, "C-ARES: %s %d|%d Sock %d port %hu\n",
-                             __FUNCTION__,
-                             read,
-                             write,
-                             sock,
-                             IO->DNS.SourcePort);
+               syslog(LOG_DEBUG, "c-ares: %s %d|%d Sock %d port %hu", __FUNCTION__, read, write, sock, IO->DNS.SourcePort);
        }
 
        IO->Now = ev_now(event_base);
index e437bd79448345a4ff0ebc0383a33b86f1f897c6..10ddfc1f3ff87a9923d41de8703b8e308ff7e32a 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Server functions which perform operations on room objects.
  *
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -341,7 +341,7 @@ void cmd_goto(char *gargs)
                                   ((ra & UA_KNOWN) == 0) &&
                                   (CCC->user.axlevel < AxAideU)
                                   ) {
-                               CTDLM_syslog(LOG_DEBUG, "Failed to acquire private room");
+                               syslog(LOG_DEBUG, "rooms: failed to acquire private room");
                        } else {
                                memcpy(&CCC->room, &QRscratch,
                                        sizeof(struct ctdlroom));
index 51ea437b7241951c9c7fb7bffe77c8178ddbe421..f0382a9c447aaf704789b48c249c9ab70b91db19 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Server functions which perform operations on user objects.
  *
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
@@ -29,11 +29,9 @@ void cmd_user(char *cmdbuf)
        char username[256];
        int a;
 
-       CON_syslog(LOG_DEBUG, "cmd_user(%s)\n", cmdbuf);
        extract_token(username, cmdbuf, 0, '|', sizeof username);
-       CON_syslog(LOG_DEBUG, "username: %s\n", username);
        striplt(username);
-       CON_syslog(LOG_DEBUG, "username: %s\n", username);
+       syslog(LOG_DEBUG, "user_ops: cmd_user(%s)", username);
 
        a = CtdlLoginExistingUser(NULL, username);
        switch (a) {
index 55d6fe6f217f043240edadb2febc8b76b66d9faa..520ae7fc8704270ac7149fbaad31d6db1f4665e6 100644 (file)
@@ -62,27 +62,12 @@ long EvIDSource = 1;
 /*****************************************************************************
  *                   libevent / curl integration                             *
  *****************************************************************************/
-#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugCurl != 0))
-
-#define EVCURL_syslog(LEVEL, FORMAT, ...)                              \
-       DBGLOG (LEVEL) syslog(LEVEL, "EVCURL:%s[%ld]CC[%d] " FORMAT,    \
-                             IOSTR, IO->ID, CCID, __VA_ARGS__)
-
-#define EVCURLM_syslog(LEVEL, FORMAT)                                  \
-       DBGLOG (LEVEL) syslog(LEVEL, "EVCURL:%s[%ld]CC[%d] " FORMAT,    \
-                             IOSTR, IO->ID, CCID)
-
-#define CURL_syslog(LEVEL, FORMAT, ...)                                        \
-       DBGLOG (LEVEL) syslog(LEVEL, "CURL: " FORMAT, __VA_ARGS__)
-
-#define CURLM_syslog(LEVEL, FORMAT)                    \
-       DBGLOG (LEVEL) syslog(LEVEL, "CURL: " FORMAT)
 
 #define MOPT(s, v)                                                     \
        do {                                                            \
                sta = curl_multi_setopt(mhnd, (CURLMOPT_##s), (v));     \
                if (sta) {                                              \
-                       EVQ_syslog(LOG_ERR, "error setting option "     \
+                       syslog(LOG_ERR, "error setting option " \
                               #s " on curl multi handle: %s\n",        \
                               curl_easy_strerror(sta));                \
                        exit (1);                                       \
@@ -110,10 +95,10 @@ gotstatus(int nnrun)
 
        global.nrun = nnrun;
 
-       CURLM_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                     "gotstatus(): about to call curl_multi_info_read\n");
        while ((msg = curl_multi_info_read(global.mhnd, &nmsg))) {
-               CURL_syslog(LOG_DEBUG,
+               syslog(LOG_DEBUG,
                            "got curl multi_info message msg=%d\n",
                            msg->msg);
 
@@ -138,14 +123,14 @@ gotstatus(int nnrun)
                        }
                        IO = (AsyncIO *)chandle;
                        if (IO->ID == 0) {
-                               EVCURL_syslog(LOG_ERR,
+                               syslog(LOG_ERR,
                                              "Error, invalid IO context %p\n",
                                              IO);
                                continue;
                        }
                        SetEVState(IO, eCurlGotStatus);
 
-                       EVCURLM_syslog(LOG_DEBUG, "request complete\n");
+                       syslog(LOG_DEBUG, "request complete\n");
 
                        IO->CitContext->lastcmd = IO->Now = ev_now(event_base);
 
@@ -154,11 +139,11 @@ gotstatus(int nnrun)
 
                        sta = msg->data.result;
                        if (sta) {
-                               EVCURL_syslog(LOG_ERR,
+                               syslog(LOG_ERR,
                                              "error description: %s\n",
                                              IO->HttpReq.errdesc);
                                IO->HttpReq.CurlError = curl_easy_strerror(sta);
-                               EVCURL_syslog(LOG_ERR,
+                               syslog(LOG_ERR,
                                              "error performing request: %s\n",
                                              IO->HttpReq.CurlError);
                                if (sta == CURLE_OPERATION_TIMEDOUT)
@@ -171,11 +156,11 @@ gotstatus(int nnrun)
                                                CURLINFO_RESPONSE_CODE,
                                                &IO->HttpReq.httpcode);
                        if (sta)
-                               EVCURL_syslog(LOG_ERR,
+                               syslog(LOG_ERR,
                                              "error asking curl for "
                                              "response code from request: %s\n",
                                              curl_easy_strerror(sta));
-                       EVCURL_syslog(LOG_DEBUG,
+                       syslog(LOG_DEBUG,
                                      "http response code was %ld\n",
                                      (long)IO->HttpReq.httpcode);
 
@@ -184,7 +169,7 @@ gotstatus(int nnrun)
                        IO->HttpReq.headers = NULL;
                        msta = curl_multi_remove_handle(global.mhnd, chnd);
                        if (msta)
-                               EVCURL_syslog(LOG_ERR,
+                               syslog(LOG_ERR,
                                              "warning problem detaching "
                                              "completed handle from curl multi: "
                                              "%s\n",
@@ -234,9 +219,9 @@ stepmulti(void *data, curl_socket_t fd, int which)
                                        which,
                                        &running_handles);
 
-       CURLM_syslog(LOG_DEBUG, "stepmulti(): calling gotstatus()\n");
+       syslog(LOG_DEBUG, "stepmulti(): calling gotstatus()\n");
        if (msta)
-               CURL_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                            "error in curl processing events"
                            "on multi handle, fd %d: %s\n",
                            (int)fd,
@@ -249,14 +234,14 @@ stepmulti(void *data, curl_socket_t fd, int which)
 static void
 gottime(struct ev_loop *loop, ev_timer *timeev, int events)
 {
-       CURLM_syslog(LOG_DEBUG, "EVCURL: waking up curl for timeout\n");
+       syslog(LOG_DEBUG, "EVCURL: waking up curl for timeout\n");
        stepmulti(NULL, CURL_SOCKET_TIMEOUT, 0);
 }
 
 static void
 got_in(struct ev_loop *loop, ev_io *ioev, int events)
 {
-       CURL_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                    "EVCURL: waking up curl for io on fd %d\n",
                    (int)ioev->fd);
 
@@ -266,7 +251,7 @@ got_in(struct ev_loop *loop, ev_io *ioev, int events)
 static void
 got_out(struct ev_loop *loop, ev_io *ioev, int events)
 {
-       CURL_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                    "waking up curl for io on fd %d\n",
                    (int)ioev->fd);
 
@@ -292,7 +277,7 @@ gotdata(void *data, size_t size, size_t nmemb, void *cglobal)
 
 static int
 gotwatchtime(CURLM *multi, long tblock_ms, void *cglobal) {
-       CURL_syslog(LOG_DEBUG, "EVCURL: gotwatchtime called %ld ms\n", tblock_ms);
+       syslog(LOG_DEBUG, "EVCURL: gotwatchtime called %ld ms\n", tblock_ms);
        evcurl_global_data *global = cglobal;
        ev_timer_stop(EV_DEFAULT, &global->timeev);
        if (tblock_ms < 0 || 14000 < tblock_ms)
@@ -320,7 +305,7 @@ gotwatchsock(CURL *easy,
        if (IO == NULL) {
                sta = curl_easy_getinfo(easy, CURLINFO_PRIVATE, &f);
                if (sta) {
-                       CURL_syslog(LOG_ERR,
+                       syslog(LOG_ERR,
                                    "EVCURL: error asking curl for private "
                                    "cookie of curl handle: %s\n",
                                    curl_easy_strerror(sta));
@@ -328,7 +313,7 @@ gotwatchsock(CURL *easy,
                }
                IO = (AsyncIO *) f;
                SetEVState(IO, eCurlNewIO);
-               EVCURL_syslog(LOG_DEBUG,
+               syslog(LOG_DEBUG,
                              "EVCURL: got socket for URL: %s\n",
                              IO->ConnectMe->PlainUrl);
 
@@ -367,19 +352,19 @@ gotwatchsock(CURL *easy,
        }
 
 
-       EVCURL_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                      "EVCURL: gotwatchsock called fd=%d action=%s[%d]\n",
                      (int)fd, Action, action);
 
        switch (action)
        {
        case CURL_POLL_NONE:
-               EVCURLM_syslog(LOG_DEBUG,
+               syslog(LOG_DEBUG,
                               "called first time "
                               "to register this sockwatcker\n");
                break;
        case CURL_POLL_REMOVE:
-               EVCURLM_syslog(LOG_DEBUG,
+               syslog(LOG_DEBUG,
                               "called last time to unregister "
                               "this sockwatcher\n");
                ev_io_stop(event_base, &IO->recv_event);
@@ -412,7 +397,7 @@ void curl_init_connectionpool(void)
 
        if (sta)
        {
-               CURL_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                            "error initializing curl library: %s\n",
                            curl_easy_strerror(sta));
 
@@ -421,7 +406,7 @@ void curl_init_connectionpool(void)
        mhnd = global.mhnd = curl_multi_init();
        if (!mhnd)
        {
-               CURLM_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                             "error initializing curl multi handle\n");
                exit(3);
        }
@@ -439,12 +424,12 @@ int evcurl_init(AsyncIO *IO)
        CURLcode sta;
        CURL *chnd;
 
-       EVCURLM_syslog(LOG_DEBUG, "EVCURL: evcurl_init called ms\n");
+       syslog(LOG_DEBUG, "EVCURL: evcurl_init called ms\n");
        IO->HttpReq.attached = 0;
        chnd = IO->HttpReq.chnd = curl_easy_init();
        if (!chnd)
        {
-               EVCURLM_syslog(LOG_ERR, "EVCURL: error initializing curl handle\n");
+               syslog(LOG_ERR, "EVCURL: error initializing curl handle\n");
                return 0;
        }
 
@@ -504,14 +489,14 @@ static void IOcurl_abort_shutdown_callback(struct ev_loop *loop,
 
        SetEVState(IO, eCurlShutdown);
        IO->CitContext->lastcmd = IO->Now = ev_now(event_base);
-       EVCURL_syslog(LOG_DEBUG, "EVENT Curl: %s\n", __FUNCTION__);
+       syslog(LOG_DEBUG, "EVENT Curl: %s\n", __FUNCTION__);
 
        curl_slist_free_all(IO->HttpReq.headers);
        IO->HttpReq.headers = NULL;
        msta = curl_multi_remove_handle(global.mhnd, IO->HttpReq.chnd);
        if (msta)
        {
-               EVCURL_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                              "EVCURL: warning problem detaching completed handle "
                              "from curl multi: %s\n",
                              curl_multi_strerror(msta));
@@ -535,7 +520,7 @@ evcurl_handle_start(AsyncIO *IO)
 
        SetEVState(IO, eCurlStart);
        chnd = IO->HttpReq.chnd;
-       EVCURL_syslog(LOG_DEBUG,
+       syslog(LOG_DEBUG,
                  "EVCURL: Loading URL: %s\n", IO->ConnectMe->PlainUrl);
        OPT(URL, IO->ConnectMe->PlainUrl);
        if (StrLength(IO->ConnectMe->CurlCreds))
@@ -558,11 +543,11 @@ evcurl_handle_start(AsyncIO *IO)
        OPT(HTTPHEADER, IO->HttpReq.headers);
 
        IO->NextState = eConnect;
-       EVCURLM_syslog(LOG_DEBUG, "EVCURL: attaching to curl multi handle\n");
+       syslog(LOG_DEBUG, "EVCURL: attaching to curl multi handle\n");
        msta = curl_multi_add_handle(global.mhnd, IO->HttpReq.chnd);
        if (msta)
        {
-               EVCURL_syslog(LOG_ERR,
+               syslog(LOG_ERR,
                          "EVCURL: error attaching to curl multi handle: %s\n",
                          curl_multi_strerror(msta));
        }
@@ -580,7 +565,7 @@ evcurl_handle_start(AsyncIO *IO)
 
 static void WakeupCurlCallback(EV_P_ ev_async *w, int revents)
 {
-       CURLM_syslog(LOG_DEBUG, "waking up curl multi handle\n");
+       syslog(LOG_DEBUG, "waking up curl multi handle\n");
 
        curl_multi_perform(&global, CURL_POLL_NONE);
 }
@@ -589,7 +574,7 @@ static void evcurl_shutdown (void)
 {
        curl_global_cleanup();
        curl_multi_cleanup(global.mhnd);
-       CURLM_syslog(LOG_DEBUG, "exiting\n");
+       syslog(LOG_DEBUG, "exiting\n");
 }
 /*****************************************************************************
  *                       libevent integration                                *
@@ -674,7 +659,7 @@ static void QueueEventAddCallback(EV_P_ ev_async *w, int revents)
        }
        DeleteHashPos(&It);
        DeleteHashContent(&q);
-       EVQ_syslog(LOG_DEBUG, "%s CC[%ld] EVENT Q Add %ld  done.", IOSTR, IOID, count);
+       syslog(LOG_DEBUG, "%s CC[%ld] EVENT Q Add %ld  done.", IOSTR, IOID, count);
 }
 
 
@@ -682,7 +667,7 @@ static void EventExitCallback(EV_P_ ev_async *w, int revents)
 {
        ev_break(event_base, EVBREAK_ALL);
 
-       EVQM_syslog(LOG_DEBUG, "EVENT Q exiting.\n");
+       syslog(LOG_DEBUG, "EVENT Q exiting.\n");
 }
 
 
@@ -712,7 +697,7 @@ void *client_event_thread(void *arg)
 
        pthread_setspecific(evConKey, IOLog);
 
-       EVQM_syslog(LOG_DEBUG, "client_event_thread() initializing\n");
+       syslog(LOG_DEBUG, "client_event_thread() initializing\n");
 
        event_base = ev_default_loop (EVFLAG_AUTO);
        ev_async_init(&AddJob, QueueEventAddCallback);
@@ -726,7 +711,7 @@ void *client_event_thread(void *arg)
 
        ev_run (event_base, 0);
 
-       EVQM_syslog(LOG_DEBUG, "client_event_thread() exiting\n");
+       syslog(LOG_DEBUG, "client_event_thread() exiting\n");
 
 ///what todo here?     CtdlClearSystemContext();
        pthread_mutex_lock(&EventExitQueueMutex);
@@ -818,13 +803,13 @@ static void DBQueueEventAddCallback(EV_P_ ev_async *w, int revents)
        }
        DeleteHashPos(&It);
        DeleteHashContent(&q);
-       EVQ_syslog(LOG_DEBUG, "%s CC[%ld] DBEVENT Q Add %ld done.", IOSTR, IOID, count);
+       syslog(LOG_DEBUG, "%s CC[%ld] DBEVENT Q Add %ld done.", IOSTR, IOID, count);
 }
 
 
 static void DBEventExitCallback(EV_P_ ev_async *w, int revents)
 {
-       EVQM_syslog(LOG_DEBUG, "DB EVENT Q exiting.\n");
+       syslog(LOG_DEBUG, "DB EVENT Q exiting.\n");
        ev_break(event_db, EVBREAK_ALL);
 }
 
@@ -855,7 +840,7 @@ void *db_event_thread(void *arg)
 
        CtdlFillSystemContext(&libev_msg_CC, "LibEv DB IO Thread");
 
-       EVQM_syslog(LOG_DEBUG, "dbevent_thread() initializing\n");
+       syslog(LOG_DEBUG, "dbevent_thread() initializing\n");
 
        tmp = event_db = ev_loop_new (EVFLAG_AUTO);
 
@@ -869,7 +854,7 @@ void *db_event_thread(void *arg)
        pthread_mutex_lock(&DBEventExitQueueMutex);
 
        event_db = NULL;
-       EVQM_syslog(LOG_INFO, "dbevent_thread() exiting\n");
+       syslog(LOG_INFO, "dbevent_thread() exiting\n");
 
        DeleteHash(&DBQueueEvents);
        DBInboundEventQueue = NULL;
@@ -885,7 +870,7 @@ void *db_event_thread(void *arg)
 
 void ShutDownEventQueues(void)
 {
-       EVQM_syslog(LOG_DEBUG, "EVENT Qs triggering exits.\n");
+       syslog(LOG_DEBUG, "EVENT Qs triggering exits.\n");
 
        pthread_mutex_lock(&DBEventQueueMutex);
        ev_async_send (event_db, &DBExitEventLoop);
index 5c20e0a923d8da22e23f4a476e547b7caf2f25a3..9c4adff9e74dcf968fa26a42aee1ec28c2c94a60 100644 (file)
@@ -293,7 +293,7 @@ void InspectQueuedRoom(SpoolControl **pSC,
        if ( (!HaveSpoolConfig(sc->RNCfg)) || (sc->room.QRhighest <= sc->RNCfg->lastsent) ) 
        {
                // There is nothing to send from this room.
-               MARK_syslog(LOG_DEBUG, "netspool: nothing to do for <%s>", room_to_spool->name);
+               syslog(LOG_DEBUG, "netspool: nothing to do for <%s>", room_to_spool->name);
                FreeRoomNetworkStruct(&sc->RNCfg);
                sc->RNCfg = NULL;
                free(sc);
@@ -808,11 +808,11 @@ void network_do_spoolin(HashList *working_ignetcfg, HashList *the_netmap, int *n
         */
        if (stat(ctdl_netin_dir, &statbuf)) return;
        if (statbuf.st_mtime == last_spoolin_mtime) {
-               MARKM_syslog(LOG_DEBUG, "netspool: nothing in inbound queue");
+               syslog(LOG_DEBUG, "netspool: nothing in inbound queue");
                return;
        }
        last_spoolin_mtime = statbuf.st_mtime;
-       MARKM_syslog(LOG_DEBUG, "netspool: processing inbound queue");
+       syslog(LOG_DEBUG, "netspool: processing inbound queue");
 
        /*
         * Ok, there's something interesting in there, so scan it.
index e23918e18dfba5f50412f264297e53145512f9ea..d5f455ab8277fbc04c94cc7fd7f0fa310e5eb94c 100644 (file)
@@ -1,42 +1,21 @@
 /*
- * Copyright (c) 2000-2012 by the citadel.org team
+ * Copyright (c) 2000-2017 by the citadel.org team
  *
- *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-extern int NetQDebugEnabled;
-
-#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (NetQDebugEnabled != 0))
-
-#define QN_syslog(LEVEL, FORMAT, ...)                          \
-       DBGLOG(LEVEL) syslog(LEVEL,                             \
-                            "CC[%d]" FORMAT, \
-                            CCC->cs_pid, __VA_ARGS__)
-
-#define QNM_syslog(LEVEL, FORMAT)                              \
-       DBGLOG(LEVEL) syslog(LEVEL,                             \
-                            "CC[%d]" FORMAT, \
-                            CCC->cs_pid)
-
-
-
 void free_netfilter_list(void);
 void load_network_filter_list(void);
-
-
-
 void network_queue_room(struct ctdlroom *, void *);
-////void destroy_network_queue_room(void);
-
index 90be427f87613dd7a2afb90ed28d22fabc194eaa..bdd175991dfc0b159e667bf4edb5019c9ba7e0a6 100644 (file)
@@ -260,19 +260,7 @@ ReadAsyncMsg *NewAsyncMsg(const char *terminator,  /* token signalling EOT */
 eReadState CtdlReadMessageBodyAsync(AsyncIO *IO);
 void DeleteAsyncMsg(ReadAsyncMsg **Msg);
 
-extern int MessageDebugEnabled;
-
-#define MSGDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (MessageDebugEnabled != 0))
-#define CCCID CCC->cs_pid
-#define MSG_syslog(LEVEL, FORMAT, ...)                 \
-       MSGDBGLOG(LEVEL) syslog(LEVEL,                  \
-                               "CC[%d]MSG " FORMAT,    \
-                               CCCID, __VA_ARGS__)
-
-#define MSGM_syslog(LEVEL, FORMAT)                     \
-       MSGDBGLOG(LEVEL) syslog(LEVEL,                  \
-                               "CC[%d]MSG " FORMAT,    \
-                               CCCID)
+
 
 
 
index 9bf2003af6c6584fe3a66ee4a88f95fa669c986b..ade4e96986fcdaa56253eda7f0b00e008a4770c5 100755 (executable)
@@ -73,12 +73,7 @@ void initialise_modules (int threading)
     long filter;
     const char *pMod;
 
-    if (threading) {
-        MODM_syslog(LOG_DEBUG, "Initializing, CtdlThreads enabled.\n");
-    }
-    else {
-        MODM_syslog(LOG_INFO, "Initializing. CtdlThreads not yet enabled.\n");
-    }
+    syslog(LOG_DEBUG, "modules: initializing, CtdlThreads %s", (threading ? "enabled" : "not yet enabled"));
 
 EOF
 
@@ -86,7 +81,7 @@ EOF
 for i in ${STATIC_FIRST_MODULES} ${DYNAMIC_MODULES} ${USER_MODULES} ${STATIC_LAST_MODULES}; do 
 cat <<EOF >> $C_FILE
        pMod = CTDL_INIT_CALL($i);
-       MOD_syslog(LOG_DEBUG, "Loaded module: %s\n", pMod);
+       syslog(LOG_DEBUG, "modules: loaded %s", pMod);
 EOF
 
 done
@@ -208,13 +203,13 @@ void upgrade_modules (void)
 {
         const char *pMod;
 
-        MODM_syslog(LOG_INFO, "Upgrade modules.\n");
+        syslog(LOG_INFO, "modules: upgrading.");
 
 EOF
 
 # Add this entry point to the .c file
 
-grep CTDL_MODULE_UPGRADE *.c modules/*/*.c  |$SED 's;.*(\(.*\));\tpMod = CTDL_UPGRADE_CALL(\1)\;\n\tMOD_syslog(LOG_INFO, "%s\\n", pMod)\;\n;' >> $U_FILE
+grep CTDL_MODULE_UPGRADE *.c modules/*/*.c  |$SED 's;.*(\(.*\));\tpMod = CTDL_UPGRADE_CALL(\1)\;\n\tsyslog(LOG_INFO, "modules: %s\\n", pMod)\;\n;' >> $U_FILE
 
 #close the upgrade file
 /usr/bin/printf "}\n" >> $U_FILE
index 95f9640335fbc69291385968ee1c75cde731d8a9..92dd06e9de6a463a627ce255a8c068492b000724 100644 (file)
 
 typedef void (*CtdlDbgFunction) (const int);
 
-extern int DebugModules;
-#define MDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (DebugModules != 0))
-
-#define MOD_syslog(LEVEL, FORMAT, ...)                                 \
-       MDBGLOG(LEVEL) syslog(LEVEL,                                    \
-                             "%s Modules: " FORMAT, IOSTR, __VA_ARGS__)
-
-#define MODM_syslog(LEVEL, FORMAT)                             \
-       MDBGLOG(LEVEL) syslog(LEVEL,                            \
-                             "%s Modules: " FORMAT, IOSTR);
-
-
-extern int EnableMarkers;
-#define MARKLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (EnableMarkers != 0))
-
-#define MARK_syslog(LEVEL, FORMAT, ...)                                        \
-       MARKLOG(LEVEL) syslog(LEVEL,                                    \
-                             "%s: " FORMAT, IOSTR, __VA_ARGS__)
-
-#define MARKM_syslog(LEVEL, FORMAT)                            \
-       MARKLOG(LEVEL) syslog(LEVEL,                            \
-                              "%s: " FORMAT, IOSTR);
-
-
-extern int EnableCtlProto;
-#define CTDLLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (EnableCtlProto != 0))
-
-#define CTDL_syslog(LEVEL, FORMAT, ...)                                        \
-       CTDLLOG(LEVEL) syslog(LEVEL,                                    \
-                             "%s CC[%d]: " FORMAT, IOSTR, CCCID, __VA_ARGS__)
-
-#define CTDLM_syslog(LEVEL, FORMAT)                            \
-       CTDLLOG(LEVEL) syslog(LEVEL,                            \
-                             "%s CC[%d]: " FORMAT, IOSTR, CCCID);
 
 
 
index 3f99aa576e29700bdc91d177830bd130c684af56..53be18071451bba5ee7777c367b60755c83f4ba1 100644 (file)
@@ -46,21 +46,21 @@ void ctdl_lockfile(int yo) {
 
 
        if (yo) {
-               syslog(LOG_DEBUG, "Creating lockfile");
+               syslog(LOG_DEBUG, "main: creating lockfile");
                snprintf(lockfilename, sizeof lockfilename, "%s/citadel.lock", ctdl_run_dir);
                fp = fopen(lockfilename, "w");
                if (!fp) {
-                       syslog(LOG_ERR, "Cannot open or create %s", lockfilename);
+                       syslog(LOG_ERR, "%s: %s", lockfilename, strerror(errno));
                        exit(CTDLEXIT_DB);
                }
                if (flock(fileno(fp), (LOCK_EX|LOCK_NB)) != 0) {
-                       syslog(LOG_ERR, "Cannot lock %s , is another citserver running?", lockfilename);
+                       syslog(LOG_ERR, "main: cannot lock %s , is another citserver running?", lockfilename);
                        exit(CTDLEXIT_DB);
                }
                return;
        }
 
-       syslog(LOG_DEBUG, "Removing lockfile");
+       syslog(LOG_DEBUG, "main: removing lockfile");
        unlink(lockfilename);
        flock(fileno(fp), LOCK_UN);
        fclose(fp);
@@ -255,18 +255,14 @@ int main(int argc, char **argv)
                pwp = NULL;
 #endif // HAVE_GETPWUID_R
 
-               if ((mkdir(ctdl_run_dir, 0755) != 0) && (errno != EEXIST))
-                       syslog(LOG_EMERG, 
-                                     "unable to create run directory [%s]: %s", 
-                                     ctdl_run_dir, strerror(errno));
+               if ((mkdir(ctdl_run_dir, 0755) != 0) && (errno != EEXIST)) {
+                       syslog(LOG_ERR, "main: unable to create run directory [%s]: %s", ctdl_run_dir, strerror(errno));
+               }
 
-               if (chown(ctdl_run_dir, ctdluid, (pwp==NULL)?-1:pw.pw_gid) != 0)
-                       syslog(LOG_EMERG, 
-                                     "unable to set the access rights for [%s]: %s", 
-                                     ctdl_run_dir, strerror(errno));
+               if (chown(ctdl_run_dir, ctdluid, (pwp==NULL)?-1:pw.pw_gid) != 0) {
+                       syslog(LOG_ERR, "main: unable to set the access rights for [%s]: %s", ctdl_run_dir, strerror(errno));
+               }
        }
-                       
-
 #endif
 
        ctdl_lockfile(1);
@@ -287,7 +283,7 @@ int main(int argc, char **argv)
        /*
         * Run any upgrade entry points
         */
-       syslog(LOG_INFO, "Upgrading modules.");
+       syslog(LOG_INFO, "main: upgrading modules");
        upgrade_modules();
        
 /*
@@ -338,7 +334,7 @@ int main(int argc, char **argv)
        /*
         * Load any server-side extensions available here.
         */
-       syslog(LOG_INFO, "Initializing server extensions");
+       syslog(LOG_INFO, "main: initializing server extensions");
        
        initialise_modules(0);
 
@@ -378,18 +374,15 @@ int main(int argc, char **argv)
 #endif // HAVE_GETPWUID_R
 
                if (pwp == NULL)
-                       syslog(LOG_CRIT, "WARNING: getpwuid(%ld): %s"
-                                  "Group IDs will be incorrect.\n", (long)CTDLUID,
-                               strerror(errno));
+                       syslog(LOG_ERR, "main: WARNING, getpwuid(%ld): %s" "Group IDs will be incorrect.", (long)CTDLUID, strerror(errno));
                else {
                        initgroups(pw.pw_name, pw.pw_gid);
                        if (setgid(pw.pw_gid))
-                               syslog(LOG_CRIT, "setgid(%ld): %s", (long)pw.pw_gid,
-                                       strerror(errno));
+                               syslog(LOG_ERR, "main: setgid(%ld): %s", (long)pw.pw_gid, strerror(errno));
                }
-               syslog(LOG_INFO, "Changing uid to %ld", (long)CTDLUID);
+               syslog(LOG_INFO, "main: changing uid to %ld", (long)CTDLUID);
                if (setuid(CTDLUID) != 0) {
-                       syslog(LOG_CRIT, "setuid() failed: %s", strerror(errno));
+                       syslog(LOG_ERR, "main: setuid() failed: %s", strerror(errno));
                }
 #if defined (HAVE_SYS_PRCTL_H) && defined (PR_SET_DUMPABLE)
                prctl(PR_SET_DUMPABLE, 1);