From: Francesco Chemolli Date: Mon, 6 Aug 2012 17:41:08 +0000 (+0200) Subject: Changed all level-0 debugs messages to use the DBG_CRITICAL definition. X-Git-Tag: sourceformat-review-1~135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa84c01d0e2fe78c6c37633eb9cdb2b248a7aab1;p=thirdparty%2Fsquid.git Changed all level-0 debugs messages to use the DBG_CRITICAL definition. --- diff --git a/src/ClientDelayConfig.cc b/src/ClientDelayConfig.cc index 7ad363e9cd..23e0de95ef 100644 --- a/src/ClientDelayConfig.cc +++ b/src/ClientDelayConfig.cc @@ -46,7 +46,7 @@ void ClientDelayConfig::dumpPoolCount(StoreEntry * entry, const char *name) cons void ClientDelayConfig::parsePoolCount() { if (pools.size()) { - debugs(3, 0, "parse_client_delay_pool_count: multiple client_delay_pools lines, aborting all previous client_delay_pools config"); + debugs(3, DBG_CRITICAL, "parse_client_delay_pool_count: multiple client_delay_pools lines, aborting all previous client_delay_pools config"); clean(); } unsigned short pools_; @@ -62,7 +62,7 @@ void ClientDelayConfig::parsePoolRates() ConfigParser::ParseUShort(&pool); if (pool < 1 || pool > pools.size()) { - debugs(3, 0, "parse_client_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << pools.size()); + debugs(3, DBG_CRITICAL, "parse_client_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << pools.size()); return; } @@ -79,7 +79,7 @@ void ClientDelayConfig::parsePoolAccess(ConfigParser &parser) ConfigParser::ParseUShort(&pool); if (pool < 1 || pool > pools.size()) { - debugs(3, 0, "parse_client_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << pools.size()); + debugs(3, DBG_CRITICAL, "parse_client_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << pools.size()); return; } diff --git a/src/ConfigParser.cc b/src/ConfigParser.cc index a69bc4b121..3d3dabf9b2 100644 --- a/src/ConfigParser.cc +++ b/src/ConfigParser.cc @@ -71,7 +71,7 @@ ConfigParser::strtokFile(void) *t = '\0'; if ((wordFile = fopen(fn, "r")) == NULL) { - debugs(28, 0, "strtokFile: " << fn << " not found"); + debugs(28, DBG_CRITICAL, "strtokFile: " << fn << " not found"); return (NULL); } diff --git a/src/DelayConfig.cc b/src/DelayConfig.cc index 73830f1ac5..442afb113a 100644 --- a/src/DelayConfig.cc +++ b/src/DelayConfig.cc @@ -65,7 +65,7 @@ DelayConfig::parsePoolClass() ConfigParser::ParseUShort(&pool); if (pool < 1 || pool > DelayPools::pools()) { - debugs(3, 0, "parse_delay_pool_class: Ignoring pool " << pool << " not in 1 .. " << DelayPools::pools()); + debugs(3, DBG_CRITICAL, "parse_delay_pool_class: Ignoring pool " << pool << " not in 1 .. " << DelayPools::pools()); return; } @@ -73,7 +73,7 @@ DelayConfig::parsePoolClass() ConfigParser::ParseUShort(&delay_class_); if (delay_class_ < 1 || delay_class_ > 5) { - debugs(3, 0, "parse_delay_pool_class: Ignoring pool " << pool << " class " << delay_class_ << " not in 1 .. 5"); + debugs(3, DBG_CRITICAL, "parse_delay_pool_class: Ignoring pool " << pool << " class " << delay_class_ << " not in 1 .. 5"); return; } @@ -89,14 +89,14 @@ DelayConfig::parsePoolRates() ConfigParser::ParseUShort(&pool); if (pool < 1 || pool > DelayPools::pools()) { - debugs(3, 0, "parse_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << DelayPools::pools()); + debugs(3, DBG_CRITICAL, "parse_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << DelayPools::pools()); return; } --pool; if (!DelayPools::delay_data[pool].theComposite().getRaw()) { - debugs(3, 0, "parse_delay_pool_rates: Ignoring pool " << pool + 1 << " attempt to set rates with class not set"); + debugs(3, DBG_CRITICAL, "parse_delay_pool_rates: Ignoring pool " << pool + 1 << " attempt to set rates with class not set"); return; } @@ -111,7 +111,7 @@ DelayConfig::parsePoolAccess(ConfigParser &parser) ConfigParser::ParseUShort(&pool); if (pool < 1 || pool > DelayPools::pools()) { - debugs(3, 0, "parse_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << DelayPools::pools()); + debugs(3, DBG_CRITICAL, "parse_delay_pool_rates: Ignoring pool " << pool << " not in 1 .. " << DelayPools::pools()); return; } diff --git a/src/DiskIO/Blocking/BlockingFile.cc b/src/DiskIO/Blocking/BlockingFile.cc index 229e977c0d..590b4986c3 100644 --- a/src/DiskIO/Blocking/BlockingFile.cc +++ b/src/DiskIO/Blocking/BlockingFile.cc @@ -223,7 +223,7 @@ BlockingFile::writeDone(int rvfd, int errflag, size_t len) writeRequest = NULL; if (errflag) { - debugs(79, 0, "storeUfsWriteDone: got failure (" << errflag << ")"); + debugs(79, DBG_CRITICAL, "storeUfsWriteDone: got failure (" << errflag << ")"); doClose(); ioRequestor->writeCompleted (DISK_ERROR,0, result); return; diff --git a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc index 018bf69d38..47bd63f146 100644 --- a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc +++ b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc @@ -172,14 +172,14 @@ DiskdIOStrategy::init() smsgid = msgget((key_t) ikey, 0700 | IPC_CREAT); if (smsgid < 0) { - debugs(50, 0, "storeDiskdInit: msgget: " << xstrerror()); + debugs(50, DBG_CRITICAL, "storeDiskdInit: msgget: " << xstrerror()); fatal("msgget failed"); } rmsgid = msgget((key_t) (ikey + 1), 0700 | IPC_CREAT); if (rmsgid < 0) { - debugs(50, 0, "storeDiskdInit: msgget: " << xstrerror()); + debugs(50, DBG_CRITICAL, "storeDiskdInit: msgget: " << xstrerror()); fatal("msgget failed"); } @@ -270,14 +270,14 @@ SharedMemory::init(int ikey, int magic2) nbufs * SHMBUF_BLKSZ, 0600 | IPC_CREAT); if (id < 0) { - debugs(50, 0, "storeDiskdInit: shmget: " << xstrerror()); + debugs(50, DBG_CRITICAL, "storeDiskdInit: shmget: " << xstrerror()); fatal("shmget failed"); } buf = (char *)shmat(id, NULL, 0); if (buf == (void *) -1) { - debugs(50, 0, "storeDiskdInit: shmat: " << xstrerror()); + debugs(50, DBG_CRITICAL, "storeDiskdInit: shmat: " << xstrerror()); fatal("shmat failed"); } diff --git a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc index 7899a0b401..fd3a5f4a3b 100644 --- a/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc +++ b/src/DiskIO/DiskThreads/DiskThreadsDiskFile.cc @@ -185,7 +185,7 @@ DiskThreadsDiskFile::openDone(int unused, const char *unused2, int anFD, int err if (errflag || fd < 0) { errno = errflag; - debugs(79, 0, "DiskThreadsDiskFile::openDone: " << xstrerror()); + debugs(79, DBG_CRITICAL, "DiskThreadsDiskFile::openDone: " << xstrerror()); debugs(79, DBG_IMPORTANT, "\t" << path_); errorOccured = true; } else { @@ -231,7 +231,7 @@ DiskThreadsDiskFile::close() ioRequestor->closeCompleted(); return; } else { - debugs(79,0,HERE << "DiskThreadsDiskFile::close: " << + debugs(79, DBG_CRITICAL, HERE << "DiskThreadsDiskFile::close: " << "did NOT close because ioInProgress() is true. now what?"); } } diff --git a/src/DiskIO/DiskThreads/aiops.cc b/src/DiskIO/DiskThreads/aiops.cc index b7658685fb..2874fdb468 100644 --- a/src/DiskIO/DiskThreads/aiops.cc +++ b/src/DiskIO/DiskThreads/aiops.cc @@ -566,10 +566,10 @@ squidaio_queue_request(squidaio_request_t * request) /* Warn if seriously overloaded */ if (request_queue_len > RIDICULOUS_LENGTH) { - debugs(43, 0, "squidaio_queue_request: Async request queue growing uncontrollably!"); - debugs(43, 0, "squidaio_queue_request: Syncing pending I/O operations.. (blocking)"); + debugs(43, DBG_CRITICAL, "squidaio_queue_request: Async request queue growing uncontrollably!"); + debugs(43, DBG_CRITICAL, "squidaio_queue_request: Syncing pending I/O operations.. (blocking)"); squidaio_sync(); - debugs(43, 0, "squidaio_queue_request: Synced"); + debugs(43, DBG_CRITICAL, "squidaio_queue_request: Synced"); } } /* squidaio_queue_request */ diff --git a/src/DiskIO/DiskThreads/aiops_win32.cc b/src/DiskIO/DiskThreads/aiops_win32.cc index 9988f977ea..6b9eb6a966 100644 --- a/src/DiskIO/DiskThreads/aiops_win32.cc +++ b/src/DiskIO/DiskThreads/aiops_win32.cc @@ -651,10 +651,10 @@ squidaio_queue_request(squidaio_request_t * request) /* Warn if seriously overloaded */ if (request_queue_len > RIDICULOUS_LENGTH) { - debugs(43, 0, "squidaio_queue_request: Async request queue growing uncontrollably!"); - debugs(43, 0, "squidaio_queue_request: Syncing pending I/O operations.. (blocking)"); + debugs(43, DBG_CRITICAL, "squidaio_queue_request: Async request queue growing uncontrollably!"); + debugs(43, DBG_CRITICAL, "squidaio_queue_request: Syncing pending I/O operations.. (blocking)"); squidaio_sync(); - debugs(43, 0, "squidaio_queue_request: Synced"); + debugs(43, DBG_CRITICAL, "squidaio_queue_request: Synced"); } } /* squidaio_queue_request */ @@ -893,7 +893,7 @@ static void squidaio_do_close(squidaio_request_t * requestp) { if ((requestp->ret = close(requestp->fd)) < 0) { - debugs(43, 0, "squidaio_do_close: FD " << requestp->fd << ", errno " << errno); + debugs(43, DBG_CRITICAL, "squidaio_do_close: FD " << requestp->fd << ", errno " << errno); close(requestp->fd); } diff --git a/src/DiskIO/IpcIo/IpcIoFile.cc b/src/DiskIO/IpcIo/IpcIoFile.cc index 6fcb791c50..58293cce08 100644 --- a/src/DiskIO/IpcIo/IpcIoFile.cc +++ b/src/DiskIO/IpcIo/IpcIoFile.cc @@ -788,7 +788,7 @@ void IpcIoFile::DiskerHandleRequest(const int workerId, IpcIoMsg &ipcIo) { if (ipcIo.command != IpcIo::cmdRead && ipcIo.command != IpcIo::cmdWrite) { - debugs(0,0, HERE << "disker" << KidIdentifier << + debugs(0, DBG_CRITICAL, HERE << "disker" << KidIdentifier << " should not receive " << ipcIo.command << " ipcIo" << workerId << '.' << ipcIo.requestId); return; @@ -830,7 +830,7 @@ DiskerOpen(const String &path, int flags, mode_t mode) if (TheFile < 0) { const int xerrno = errno; - debugs(47,0, HERE << "rock db error opening " << path << ": " << + debugs(47, DBG_CRITICAL, HERE << "rock db error opening " << path << ": " << xstrerr(xerrno)); return false; } diff --git a/src/EventLoop.cc b/src/EventLoop.cc index 15b7d14b54..58dcff15d3 100644 --- a/src/EventLoop.cc +++ b/src/EventLoop.cc @@ -134,7 +134,7 @@ EventLoop::runOnce() if (error) { ++errcount; - debugs(1, 0, "Select loop Error. Retry " << errcount); + debugs(1, DBG_CRITICAL, "Select loop Error. Retry " << errcount); } else errcount = 0; diff --git a/src/HelperChildConfig.cc b/src/HelperChildConfig.cc index ef6826b076..b7c2df3bab 100644 --- a/src/HelperChildConfig.cc +++ b/src/HelperChildConfig.cc @@ -59,7 +59,7 @@ HelperChildConfig::parseConfig() } else if (strncmp(token, "idle=", 5) == 0) { n_idle = atoi(token + 5); if (n_idle < 1) { - debugs(0,0,"WARNING OVERIDE: Using idle=0 for helpers causes request failures. Overiding to use idle=1 instead."); + debugs(0, DBG_CRITICAL, "WARNING OVERIDE: Using idle=0 for helpers causes request failures. Overiding to use idle=1 instead."); n_idle = 1; } } else if (strncmp(token, "concurrency=", 12) == 0) { @@ -72,12 +72,12 @@ HelperChildConfig::parseConfig() /* simple sanity. */ if (n_startup > n_max) { - debugs(0,0,"WARNING OVERIDE: Capping startup=" << n_startup << " to the defined maximum (" << n_max <<")"); + debugs(0, DBG_CRITICAL, "WARNING OVERIDE: Capping startup=" << n_startup << " to the defined maximum (" << n_max <<")"); n_startup = n_max; } if (n_idle > n_max) { - debugs(0,0,"WARNING OVERIDE: Capping idle=" << n_idle << " to the defined maximum (" << n_max <<")"); + debugs(0, DBG_CRITICAL, "WARNING OVERIDE: Capping idle=" << n_idle << " to the defined maximum (" << n_max <<")"); n_idle = n_max; } } diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 024c7b0ab1..9ea97ffb2c 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -456,7 +456,7 @@ HttpHeader::clean() /* tmp hack to try to avoid coredumps */ if (e->id < 0 || e->id >= HDR_ENUM_END) { - debugs(55, 0, "HttpHeader::clean BUG: entry[" << pos << "] is invalid (" << e->id << "). Ignored."); + debugs(55, DBG_CRITICAL, "HttpHeader::clean BUG: entry[" << pos << "] is invalid (" << e->id << "). Ignored."); } else { HttpHeaderStats[owner].fieldTypeDistr.count(e->id); /* yes, this deletion leaves us in an inconsistent state */ diff --git a/src/StoreMeta.cc b/src/StoreMeta.cc index beac7c9386..86a155abf1 100644 --- a/src/StoreMeta.cc +++ b/src/StoreMeta.cc @@ -49,7 +49,7 @@ StoreMeta::validType(char type) { /* VOID is reserved, and new types have to be added as classes */ if (type <= STORE_META_VOID || type >= STORE_META_END + 10) { - debugs(20, 0, "storeSwapMetaUnpack: bad type (" << type << ")!"); + debugs(20, DBG_CRITICAL, "storeSwapMetaUnpack: bad type (" << type << ")!"); return false; } @@ -66,7 +66,7 @@ StoreMeta::validType(char type) type == STORE_META_KEY_SHA || type == STORE_META_HITMETERING || type == STORE_META_VALID) { - debugs(20, 0, "Obsolete and unused type (" << type << ") in disk metadata"); + debugs(20, DBG_CRITICAL, "Obsolete and unused type (" << type << ") in disk metadata"); return false; } @@ -104,7 +104,7 @@ bool StoreMeta::validLength(int aLength) const { if (!IntRange (MinimumTLVLength, MaximumTLVLength).includes(aLength)) { - debugs(20, 0, "storeSwapMetaUnpack: insane length (" << aLength << ")!"); + debugs(20, DBG_CRITICAL, "storeSwapMetaUnpack: insane length (" << aLength << ")!"); return false; } @@ -147,7 +147,7 @@ StoreMeta::Factory (char type, size_t len, void const *value) break; default: - debugs(20, 0, "Attempt to create unknown concrete StoreMeta"); + debugs(20, DBG_CRITICAL, "Attempt to create unknown concrete StoreMeta"); return NULL; } diff --git a/src/StoreMetaUnpacker.cc b/src/StoreMetaUnpacker.cc index a97edbcf4d..ed9f66c618 100644 --- a/src/StoreMetaUnpacker.cc +++ b/src/StoreMetaUnpacker.cc @@ -110,8 +110,8 @@ StoreMetaUnpacker::doOneEntry() getLength(); if (position + length > *hdr_len) { - debugs(20, 0, "storeSwapMetaUnpack: overflow!"); - debugs(20, 0, "\ttype=" << type << ", length=" << length << ", *hdr_len=" << *hdr_len << ", offset=" << position); + debugs(20, DBG_CRITICAL, "storeSwapMetaUnpack: overflow!"); + debugs(20, DBG_CRITICAL, "\ttype=" << type << ", length=" << length << ", *hdr_len=" << *hdr_len << ", offset=" << position); return false; } diff --git a/src/acl/Acl.cc b/src/acl/Acl.cc index b77b0e33f3..3dbe2d4ed8 100644 --- a/src/acl/Acl.cc +++ b/src/acl/Acl.cc @@ -99,13 +99,13 @@ ACL::ParseAclLine(ConfigParser &parser, ACL ** head) /* snarf the ACL name */ if ((t = strtok(NULL, w_space)) == NULL) { - debugs(28, 0, "aclParseAclLine: missing ACL name."); + debugs(28, DBG_CRITICAL, "aclParseAclLine: missing ACL name."); parser.destruct(); return; } if (strlen(t) >= ACL_NAME_SZ) { - debugs(28, 0, "aclParseAclLine: aclParseAclLine: ACL name '" << t << + debugs(28, DBG_CRITICAL, "aclParseAclLine: aclParseAclLine: ACL name '" << t << "' too long, max " << ACL_NAME_SZ - 1 << " characters supported"); parser.destruct(); return; @@ -116,7 +116,7 @@ ACL::ParseAclLine(ConfigParser &parser, ACL ** head) const char *theType; if ((theType = strtok(NULL, w_space)) == NULL) { - debugs(28, 0, "aclParseAclLine: missing ACL type."); + debugs(28, DBG_CRITICAL, "aclParseAclLine: missing ACL type."); parser.destruct(); return; } @@ -160,7 +160,7 @@ ACL::ParseAclLine(ConfigParser &parser, ACL ** head) new_acl = 1; } else { if (strcmp (A->typeString(),theType) ) { - debugs(28, 0, "aclParseAclLine: ACL '" << A->name << "' already exists with different type."); + debugs(28, DBG_CRITICAL, "aclParseAclLine: ACL '" << A->name << "' already exists with different type."); parser.destruct(); return; } @@ -187,7 +187,7 @@ ACL::ParseAclLine(ConfigParser &parser, ACL ** head) return; if (A->empty()) { - debugs(28, 0, "Warning: empty ACL: " << A->cfgline); + debugs(28, DBG_CRITICAL, "Warning: empty ACL: " << A->cfgline); } if (!A->valid()) { diff --git a/src/acl/Arp.cc b/src/acl/Arp.cc index bccbca1637..5644855bd1 100644 --- a/src/acl/Arp.cc +++ b/src/acl/Arp.cc @@ -115,14 +115,14 @@ aclParseArpData(const char *t) debugs(28, 5, "aclParseArpData: " << t); if (sscanf(t, "%[0-9a-fA-F:]", buf) != 1) { - debugs(28, 0, "aclParseArpData: Bad ethernet address: '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseArpData: Bad ethernet address: '" << t << "'"); safe_free(q); return NULL; } if (!q->decode(buf)) { - debugs(28, 0, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseArpData: Ignoring invalid ARP acl entry: can't parse '" << buf << "'"); + debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseArpData: Ignoring invalid ARP acl entry: can't parse '" << buf << "'"); safe_free(q); return NULL; } diff --git a/src/acl/Eui64.cc b/src/acl/Eui64.cc index 26c56affb4..105388fe52 100644 --- a/src/acl/Eui64.cc +++ b/src/acl/Eui64.cc @@ -89,14 +89,14 @@ aclParseEuiData(const char *t) debugs(28, 5, "aclParseEuiData: " << t); if (sscanf(t, "%[0-9a-fA-F:]", buf) != 1) { - debugs(28, 0, "aclParseEuiData: Bad EUI-64 address: '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseEuiData: Bad EUI-64 address: '" << t << "'"); safe_free(q); return NULL; } if (!q->decode(buf)) { - debugs(28, 0, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseEuiData: Ignoring invalid EUI-64 acl entry: can't parse '" << buf << "'"); + debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseEuiData: Ignoring invalid EUI-64 acl entry: can't parse '" << buf << "'"); safe_free(q); return NULL; } diff --git a/src/acl/Gadgets.cc b/src/acl/Gadgets.cc index 42ad7569de..f42f806f5f 100644 --- a/src/acl/Gadgets.cc +++ b/src/acl/Gadgets.cc @@ -120,8 +120,8 @@ aclParseDenyInfoLine(acl_deny_info_list ** head) /* first expect a page name */ if ((t = strtok(NULL, w_space)) == NULL) { - debugs(28, 0, "aclParseDenyInfoLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseDenyInfoLine: missing 'error page' parameter."); + debugs(28, DBG_CRITICAL, "aclParseDenyInfoLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseDenyInfoLine: missing 'error page' parameter."); return; } @@ -140,8 +140,8 @@ aclParseDenyInfoLine(acl_deny_info_list ** head) } if (A->acl_list == NULL) { - debugs(28, 0, "aclParseDenyInfoLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseDenyInfoLine: deny_info line contains no ACL's, skipping"); + debugs(28, DBG_CRITICAL, "aclParseDenyInfoLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseDenyInfoLine: deny_info line contains no ACL's, skipping"); memFree(A, MEM_ACL_DENY_INFO_LIST); return; } @@ -163,8 +163,8 @@ aclParseAccessLine(ConfigParser &parser, acl_access ** head) /* first expect either 'allow' or 'deny' */ if ((t = strtok(NULL, w_space)) == NULL) { - debugs(28, 0, "aclParseAccessLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseAccessLine: missing 'allow' or 'deny'."); + debugs(28, DBG_CRITICAL, "aclParseAccessLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseAccessLine: missing 'allow' or 'deny'."); return; } @@ -175,8 +175,8 @@ aclParseAccessLine(ConfigParser &parser, acl_access ** head) else if (!strcmp(t, "deny")) A->allow = ACCESS_DENIED; else { - debugs(28, 0, "aclParseAccessLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseAccessLine: expecting 'allow' or 'deny', got '" << t << "'."); + debugs(28, DBG_CRITICAL, "aclParseAccessLine: " << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseAccessLine: expecting 'allow' or 'deny', got '" << t << "'."); delete A; return; } @@ -184,8 +184,8 @@ aclParseAccessLine(ConfigParser &parser, acl_access ** head) aclParseAclList(parser, &A->aclList); if (A->aclList == NULL) { - debugs(28, 0, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseAccessLine: Access line contains no ACL's, skipping"); + debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(28, DBG_CRITICAL, "aclParseAccessLine: Access line contains no ACL's, skipping"); delete A; return; } @@ -221,7 +221,7 @@ aclParseAclList(ConfigParser &parser, ACLList ** head) a = ACL::FindByName(t); if (a == NULL) { - debugs(28, 0, "aclParseAclList: ACL name '" << t << "' not found."); + debugs(28, DBG_CRITICAL, "aclParseAclList: ACL name '" << t << "' not found."); delete L; parser.destruct(); continue; diff --git a/src/acl/HttpStatus.cc b/src/acl/HttpStatus.cc index 0d4cee4c86..dfb7a7a778 100644 --- a/src/acl/HttpStatus.cc +++ b/src/acl/HttpStatus.cc @@ -76,9 +76,9 @@ int acl_httpstatus_data::compare(acl_httpstatus_data* const& a, acl_httpstatus_d char bufb[8]; a->toStr(bufa, sizeof(bufa)); b->toStr(bufb, sizeof(bufb)); - debugs(28, 0, "WARNING: '" << bufa << "' is a subrange of '" << bufb << "'"); - debugs(28, 0, "WARNING: because of this '" << bufa << "' is ignored to keep splay tree searching predictable"); - debugs(28, 0, "WARNING: You should probably remove '" << bufb << "' from the ACL named '" << AclMatchedName << "'"); + debugs(28, DBG_CRITICAL, "WARNING: '" << bufa << "' is a subrange of '" << bufb << "'"); + debugs(28, DBG_CRITICAL, "WARNING: because of this '" << bufa << "' is ignored to keep splay tree searching predictable"); + debugs(28, DBG_CRITICAL, "WARNING: You should probably remove '" << bufb << "' from the ACL named '" << AclMatchedName << "'"); } return ret; diff --git a/src/acl/IntRange.cc b/src/acl/IntRange.cc index 186b1ce7a5..7a83665047 100644 --- a/src/acl/IntRange.cc +++ b/src/acl/IntRange.cc @@ -71,7 +71,7 @@ ACLIntRange::parse() temp.end = port2+1; ranges.push_back(temp); } else { - debugs(28, 0, "ACLIntRange::parse: Invalid port value"); + debugs(28, DBG_CRITICAL, "ACLIntRange::parse: Invalid port value"); self_destruct(); } } diff --git a/src/acl/Ip.cc b/src/acl/Ip.cc index a91d464a65..eb6ef92fb3 100644 --- a/src/acl/Ip.cc +++ b/src/acl/Ip.cc @@ -179,9 +179,9 @@ acl_ip_data::NetworkCompare(acl_ip_data * const & a, acl_ip_data * const &b) a->toStr(buf_n1, 3*(MAX_IPSTRLEN+1)); b->toStr(buf_n2, 3*(MAX_IPSTRLEN+1)); } - debugs(28, 0, "WARNING: (" << (bina?'B':'A') << ") '" << buf_n1 << "' is a subnetwork of (" << (bina?'A':'B') << ") '" << buf_n2 << "'"); - debugs(28, 0, "WARNING: because of this '" << (bina?buf_n2:buf_n1) << "' is ignored to keep splay tree searching predictable"); - debugs(28, 0, "WARNING: You should probably remove '" << buf_n1 << "' from the ACL named '" << AclMatchedName << "'"); + debugs(28, DBG_CRITICAL, "WARNING: (" << (bina?'B':'A') << ") '" << buf_n1 << "' is a subnetwork of (" << (bina?'A':'B') << ") '" << buf_n2 << "'"); + debugs(28, DBG_CRITICAL, "WARNING: because of this '" << (bina?buf_n2:buf_n1) << "' is ignored to keep splay tree searching predictable"); + debugs(28, DBG_CRITICAL, "WARNING: You should probably remove '" << buf_n1 << "' from the ACL named '" << AclMatchedName << "'"); } return ret; @@ -422,7 +422,7 @@ acl_ip_data::FactoryParse(const char *t) int errcode = getaddrinfo(addr1,NULL,&hints,&hp); if (hp == NULL) { - debugs(28, 0, "aclIpParseIpData: Bad host/IP: '" << addr1 << + debugs(28, DBG_CRITICAL, "aclIpParseIpData: Bad host/IP: '" << addr1 << "' in '" << t << "', flags=" << hints.ai_flags << " : (" << errcode << ") " << gai_strerror(errcode) ); self_destruct(); @@ -458,7 +458,7 @@ acl_ip_data::FactoryParse(const char *t) } if (*Q != NULL) { - debugs(28, 0, "aclIpParseIpData: Bad host/IP: '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclIpParseIpData: Bad host/IP: '" << t << "'"); self_destruct(); return NULL; } @@ -476,7 +476,7 @@ acl_ip_data::FactoryParse(const char *t) /* Decode addr1 */ if (!*addr1 || !(q->addr1 = addr1)) { - debugs(28, 0, "aclIpParseIpData: unknown first address in '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclIpParseIpData: unknown first address in '" << t << "'"); delete q; self_destruct(); return NULL; @@ -486,7 +486,7 @@ acl_ip_data::FactoryParse(const char *t) if (!*addr2) q->addr2.SetAnyAddr(); else if (!(q->addr2=addr2) ) { - debugs(28, 0, "aclIpParseIpData: unknown second address in '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclIpParseIpData: unknown second address in '" << t << "'"); delete q; self_destruct(); return NULL; @@ -494,7 +494,7 @@ acl_ip_data::FactoryParse(const char *t) /* Decode mask (NULL or empty means a exact host mask) */ if (!DecodeMask(mask, q->mask, iptype)) { - debugs(28, 0, "aclParseIpData: unknown netmask '" << mask << "' in '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseIpData: unknown netmask '" << mask << "' in '" << t << "'"); delete q; self_destruct(); return NULL; @@ -505,7 +505,7 @@ acl_ip_data::FactoryParse(const char *t) changed += q->addr2.ApplyMask(q->mask); if (changed) - debugs(28, 0, "aclIpParseIpData: WARNING: Netmask masks away part of the specified IP in '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclIpParseIpData: WARNING: Netmask masks away part of the specified IP in '" << t << "'"); debugs(28,9, HERE << "Parsed: " << q->addr1 << "-" << q->addr2 << "/" << q->mask << "(/" << q->mask.GetCIDR() <<")"); diff --git a/src/acl/MaxConnection.cc b/src/acl/MaxConnection.cc index 81a848aca0..c44737d9c8 100644 --- a/src/acl/MaxConnection.cc +++ b/src/acl/MaxConnection.cc @@ -120,5 +120,5 @@ ACLMaxConnection::prepareForUse() if (0 != Config.onoff.client_db) return; - debugs(22, 0, "WARNING: 'maxconn' ACL (" << name << ") won't work with client_db disabled"); + debugs(22, DBG_CRITICAL, "WARNING: 'maxconn' ACL (" << name << ") won't work with client_db disabled"); } diff --git a/src/acl/Random.cc b/src/acl/Random.cc index 20ac84cffd..3b70b7458e 100644 --- a/src/acl/Random.cc +++ b/src/acl/Random.cc @@ -88,7 +88,7 @@ ACLRandom::parse() int a = xatoi(bufa); int b = xatoi(bufb); if (a == 0 || b == 0) { - debugs(28, 0, "aclParseRandomData: Bad Pattern: '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseRandomData: Bad Pattern: '" << t << "'"); self_destruct(); } else data = a / (double)(a+b); @@ -96,14 +96,14 @@ ACLRandom::parse() int a = xatoi(bufa); int b = xatoi(bufb); if (a == 0 || b == 0) { - debugs(28, 0, "aclParseRandomData: Bad Pattern: '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseRandomData: Bad Pattern: '" << t << "'"); self_destruct(); } else data = (double) a / (double) b; } else if (sscanf(t, "0.%[0-9]", bufa) == 1) { data = atof(t); } else { - debugs(28, 0, "aclParseRandomData: Bad Pattern: '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseRandomData: Bad Pattern: '" << t << "'"); self_destruct(); } diff --git a/src/acl/TimeData.cc b/src/acl/TimeData.cc index 78771ccd71..01ff2c7bb2 100644 --- a/src/acl/TimeData.cc +++ b/src/acl/TimeData.cc @@ -178,9 +178,9 @@ ACLTimeData::parse() break; default: - debugs(28, 0, "" << cfg_filename << " line " << config_lineno << + debugs(28, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(28, 0, "aclParseTimeSpec: Bad Day '" << *t << "'" ); + debugs(28, DBG_CRITICAL, "aclParseTimeSpec: Bad Day '" << *t << "'" ); break; } } @@ -188,7 +188,7 @@ ACLTimeData::parse() /* assume its time-of-day spec */ if ((sscanf(t, "%d:%d-%d:%d", &h1, &m1, &h2, &m2) < 4) || (!((h1 >= 0 && h1 < 24) && ((h2 >= 0 && h2 < 24) || (h2 == 24 && m2 == 0)) && (m1 >= 0 && m1 < 60) && (m2 >= 0 && m2 < 60)))) { - debugs(28, 0, "aclParseTimeSpec: Bad time range '" << t << "'"); + debugs(28, DBG_CRITICAL, "aclParseTimeSpec: Bad time range '" << t << "'"); self_destruct(); if (q != this) @@ -211,7 +211,7 @@ ACLTimeData::parse() parsed_weekbits = 0; if (q->start > q->stop) { - debugs(28, 0, "aclParseTimeSpec: Reversed time range"); + debugs(28, DBG_CRITICAL, "aclParseTimeSpec: Reversed time range"); self_destruct(); if (q != this) diff --git a/src/adaptation/AccessRule.cc b/src/adaptation/AccessRule.cc index 1a5b3bd403..e76e665966 100644 --- a/src/adaptation/AccessRule.cc +++ b/src/adaptation/AccessRule.cc @@ -39,7 +39,7 @@ Adaptation::AccessRule::finalize() } if (!group()) { - debugs(93,0, "ERROR: Unknown adaptation service or group name: '" << + debugs(93, DBG_CRITICAL, "ERROR: Unknown adaptation service or group name: '" << groupId << "'"); // TODO: fail on failures } } diff --git a/src/adaptation/Config.cc b/src/adaptation/Config.cc index 2d749775c7..d22300b3db 100644 --- a/src/adaptation/Config.cc +++ b/src/adaptation/Config.cc @@ -219,7 +219,7 @@ Adaptation::Config::finalize() for (VISCI i = configs.begin(); i != configs.end(); ++i) { const ServiceConfigPointer cfg = *i; if (FindService(cfg->key) != NULL) { - debugs(93,0, "ERROR: Duplicate adaptation service name: " << + debugs(93, DBG_CRITICAL, "ERROR: Duplicate adaptation service name: " << cfg->key); continue; // TODO: make fatal } diff --git a/src/adaptation/ServiceConfig.cc b/src/adaptation/ServiceConfig.cc index 48d43a7857..b6f942de6d 100644 --- a/src/adaptation/ServiceConfig.cc +++ b/src/adaptation/ServiceConfig.cc @@ -155,7 +155,7 @@ Adaptation::ServiceConfig::grokUri(const char *value) // AYJ: most of this is duplicate of urlParse() in src/url.cc if (!value || !*value) { - debugs(3, 0, HERE << cfg_filename << ':' << config_lineno << ": " << + debugs(3, DBG_CRITICAL, HERE << cfg_filename << ':' << config_lineno << ": " << "empty adaptation service URI"); return false; } @@ -240,7 +240,7 @@ Adaptation::ServiceConfig::grokUri(const char *value) len = e - s; if (len > 1024) { - debugs(3, 0, HERE << cfg_filename << ':' << config_lineno << ": " << + debugs(3, DBG_CRITICAL, HERE << cfg_filename << ':' << config_lineno << ": " << "long resource name (>1024), probably wrong"); } @@ -257,7 +257,7 @@ Adaptation::ServiceConfig::grokBool(bool &var, const char *name, const char *val else if (!strcmp(value, "1") || !strcmp(value, "on")) var = true; else { - debugs(3, 0, HERE << cfg_filename << ':' << config_lineno << ": " << + debugs(3, DBG_CRITICAL, HERE << cfg_filename << ':' << config_lineno << ": " << "wrong value for boolean " << name << "; " << "'0', '1', 'on', or 'off' expected but got: " << value); return false; diff --git a/src/adaptation/ServiceGroups.cc b/src/adaptation/ServiceGroups.cc index 81eeb5d8f2..b77e56e238 100644 --- a/src/adaptation/ServiceGroups.cc +++ b/src/adaptation/ServiceGroups.cc @@ -75,7 +75,7 @@ Adaptation::ServiceGroup::finalize() baselineKey = service->cfg().key; baselineBypass = service->cfg().bypass; } else if (baselineBypass != service->cfg().bypass) { - debugs(93,0, "WARNING: Inconsistent bypass in " << kind << + debugs(93, DBG_CRITICAL, "WARNING: Inconsistent bypass in " << kind << ' ' << id << " may produce surprising results: " << baselineKey << " vs. " << serviceId); } diff --git a/src/auth/AclProxyAuth.cc b/src/auth/AclProxyAuth.cc index 69f29ede46..d254a07182 100644 --- a/src/auth/AclProxyAuth.cc +++ b/src/auth/AclProxyAuth.cc @@ -117,12 +117,12 @@ bool ACLProxyAuth::valid () const { if (authenticateSchemeCount() == 0) { - debugs(28, 0, "Can't use proxy auth because no authentication schemes were compiled."); + debugs(28, DBG_CRITICAL, "Can't use proxy auth because no authentication schemes were compiled."); return false; } if (authenticateActiveSchemeCount() == 0) { - debugs(28, 0, "Can't use proxy auth because no authentication schemes are fully configured."); + debugs(28, DBG_CRITICAL, "Can't use proxy auth because no authentication schemes are fully configured."); return false; } diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index 4fb31c394d..5aefe77ae8 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -667,7 +667,7 @@ Auth::Digest::Config::parse(Auth::Config * scheme, int n_configured, char *param } else if (strcasecmp(param_str, "utf8") == 0) { parse_onoff(&utf8); } else { - debugs(29, 0, "unrecognised digest auth scheme parameter '" << param_str << "'"); + debugs(29, DBG_CRITICAL, "unrecognised digest auth scheme parameter '" << param_str << "'"); } } diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 191ccb5363..dc903b5f35 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -537,7 +537,7 @@ parseOneConfigFile(const char *file_name, unsigned int depth) if (tmp_line_len >= 9 && strncmp(tmp_line, "include", 7) == 0 && xisspace(tmp_line[7])) { err_count += parseManyConfigFiles(tmp_line + 8, depth + 1); } else if (!parse_line(tmp_line)) { - debugs(3, 0, HERE << cfg_filename << ":" << config_lineno << " unrecognized: '" << tmp_line << "'"); + debugs(3, DBG_CRITICAL, HERE << cfg_filename << ":" << config_lineno << " unrecognized: '" << tmp_line << "'"); ++err_count; } } @@ -633,7 +633,7 @@ configDoConfigure(void) #if SIZEOF_OFF_T <= 4 if (Config.Store.maxObjectSize > 0x7FFF0000) { - debugs(3, 0, "WARNING: This Squid binary can not handle files larger than 2GB. Limiting maximum_object_size to just below 2GB"); + debugs(3, DBG_CRITICAL, "WARNING: This Squid binary can not handle files larger than 2GB. Limiting maximum_object_size to just below 2GB"); Config.Store.maxObjectSize = 0x7FFF0000; } #endif @@ -642,7 +642,7 @@ configDoConfigure(void) (void) 0; else if (Store::Root().maxSize() < Config.memMaxSize) /* This is bogus. folk with NULL caches will want this */ - debugs(3, 0, "WARNING cache_mem is larger than total disk cache space!"); + debugs(3, DBG_CRITICAL, "WARNING cache_mem is larger than total disk cache space!"); if (Config.Announce.period > 0) { Config.onoff.announce = 1; @@ -987,7 +987,7 @@ parseTimeLine(time_msec_t * tptr, const char *units, bool allowMsec) if (0 == d) (void) 0; else if ((token = strtok(NULL, w_space)) == NULL) - debugs(3, 0, "WARNING: No units on '" << + debugs(3, DBG_CRITICAL, "WARNING: No units on '" << config_input_line << "', assuming " << d << " " << units ); else if ((m = parseTimeUnits(token, allowMsec)) == 0) @@ -1064,7 +1064,7 @@ parseBytesLine64(int64_t * bptr, const char *units) if (0.0 == d) (void) 0; else if ((token = strtok(NULL, w_space)) == NULL) - debugs(3, 0, "WARNING: No units on '" << + debugs(3, DBG_CRITICAL, "WARNING: No units on '" << config_input_line << "', assuming " << d << " " << units ); else if ((m = parseBytesUnits(token)) == 0) { @@ -1109,7 +1109,7 @@ parseBytesLine(size_t * bptr, const char *units) if (0.0 == d) (void) 0; else if ((token = strtok(NULL, w_space)) == NULL) - debugs(3, 0, "WARNING: No units on '" << + debugs(3, DBG_CRITICAL, "WARNING: No units on '" << config_input_line << "', assuming " << d << " " << units ); else if ((m = parseBytesUnits(token)) == 0) { @@ -1154,7 +1154,7 @@ parseBytesLineSigned(ssize_t * bptr, const char *units) if (0.0 == d) (void) 0; else if ((token = strtok(NULL, w_space)) == NULL) - debugs(3, 0, "WARNING: No units on '" << + debugs(3, DBG_CRITICAL, "WARNING: No units on '" << config_input_line << "', assuming " << d << " " << units ); else if ((m = parseBytesUnits(token)) == 0) { @@ -1699,8 +1699,8 @@ parse_http_header_access(HeaderManglers **pm) char *t = NULL; if ((t = strtok(NULL, w_space)) == NULL) { - debugs(3, 0, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(3, 0, "parse_http_header_access: missing header name."); + debugs(3, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(3, DBG_CRITICAL, "parse_http_header_access: missing header name."); return; } @@ -1735,8 +1735,8 @@ parse_http_header_replace(HeaderManglers **pm) char *t = NULL; if ((t = strtok(NULL, w_space)) == NULL) { - debugs(3, 0, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(3, 0, "parse_http_header_replace: missing header name."); + debugs(3, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(3, DBG_CRITICAL, "parse_http_header_replace: missing header name."); return; } @@ -1880,7 +1880,7 @@ parse_cachedir(SquidConfig::_cacheSwap * swap) sd = dynamic_cast(swap->swapDirs[i].getRaw()); if (strcmp(sd->type(), StoreFileSystem::FileSystems().items[fs]->type()) != 0) { - debugs(3, 0, "ERROR: Can't change type of existing cache_dir " << + debugs(3, DBG_CRITICAL, "ERROR: Can't change type of existing cache_dir " << sd->type() << " " << sd->path << " to " << type_str << ". Restart required"); return; } @@ -2283,7 +2283,7 @@ parse_peer(peer ** head) } else if (strcmp(token, "connection-auth=auto") == 0) { p->connection_auth = 2; } else { - debugs(3, 0, "parse_peer: token='" << token << "'"); + debugs(3, DBG_CRITICAL, "parse_peer: token='" << token << "'"); self_destruct(); } } @@ -2391,7 +2391,7 @@ parse_cachemgrpasswd(cachemgr_passwd ** head) if (strcmp(w->key, u->key)) continue; - debugs(0, 0, "WARNING: action '" << u->key << "' (line " << config_lineno << ") already has a password"); + debugs(0, DBG_CRITICAL, "WARNING: action '" << u->key << "' (line " << config_lineno << ") already has a password"); } } } @@ -2468,7 +2468,7 @@ parse_peer_access(void) self_destruct(); if ((p = peerFindByName(host)) == NULL) { - debugs(15, 0, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'"); + debugs(15, DBG_CRITICAL, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'"); return; } @@ -2490,7 +2490,7 @@ parse_hostdomain(void) peer *p; if ((p = peerFindByName(host)) == NULL) { - debugs(15, 0, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'"); + debugs(15, DBG_CRITICAL, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'"); continue; } @@ -2528,7 +2528,7 @@ parse_hostdomaintype(void) peer *p; if ((p = peerFindByName(host)) == NULL) { - debugs(15, 0, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'"); + debugs(15, DBG_CRITICAL, "" << cfg_filename << ", line " << config_lineno << ": No cache_peer '" << host << "'"); return; } @@ -2792,14 +2792,14 @@ parse_refreshpattern(refresh_t ** head) #endif } else - debugs(22, 0, "refreshAddToList: Unknown option '" << pattern << "': " << token); + debugs(22, DBG_CRITICAL, "refreshAddToList: Unknown option '" << pattern << "': " << token); } if ((errcode = regcomp(&comp, pattern, flags)) != 0) { char errbuf[256]; regerror(errcode, &comp, errbuf, sizeof errbuf); - debugs(22, 0, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); - debugs(22, 0, "refreshAddToList: Invalid regular expression '" << pattern << "': " << errbuf); + debugs(22, DBG_CRITICAL, "" << cfg_filename << " line " << config_lineno << ": " << config_input_line); + debugs(22, DBG_CRITICAL, "refreshAddToList: Invalid regular expression '" << pattern << "': " << errbuf); return; } @@ -3372,7 +3372,7 @@ parseNeighborType(const char *s) if (!strcasecmp(s, "multicast")) return PEER_MULTICAST; - debugs(15, 0, "WARNING: Unknown neighbor type: " << s); + debugs(15, DBG_CRITICAL, "WARNING: Unknown neighbor type: " << s); return PEER_SIBLING; } @@ -4005,7 +4005,7 @@ parse_access_log(customlog ** logs) cl->type = Log::Format::CLF_CUSTOM; cl->logFormat = lf; } else if (strcmp(logdef_name, "auto") == 0) { - debugs(0,0, "WARNING: Log format 'auto' no longer exists. Using 'squid' instead."); + debugs(0, DBG_CRITICAL, "WARNING: Log format 'auto' no longer exists. Using 'squid' instead."); cl->type = Log::Format::CLF_SQUID; } else if (strcmp(logdef_name, "squid") == 0) { cl->type = Log::Format::CLF_SQUID; @@ -4022,7 +4022,7 @@ parse_access_log(customlog ** logs) } else if (strcmp(logdef_name, "referrer") == 0) { cl->type = Log::Format::CLF_REFERER; } else { - debugs(3, 0, "Log format '" << logdef_name << "' is not defined"); + debugs(3, DBG_CRITICAL, "Log format '" << logdef_name << "' is not defined"); self_destruct(); return; } @@ -4254,7 +4254,7 @@ dump_icap_service_type(StoreEntry * entry, const char *name, const Adaptation::I static void parse_icap_class_type() { - debugs(93, 0, "WARNING: 'icap_class' is depricated. " << + debugs(93, DBG_CRITICAL, "WARNING: 'icap_class' is depricated. " << "Use 'adaptation_service_set' instead"); Adaptation::Config::ParseServiceSet(); } @@ -4262,7 +4262,7 @@ parse_icap_class_type() static void parse_icap_access_type() { - debugs(93, 0, "WARNING: 'icap_access' is depricated. " << + debugs(93, DBG_CRITICAL, "WARNING: 'icap_access' is depricated. " << "Use 'adaptation_access' instead"); Adaptation::Config::ParseAccess(LegacyParser); } @@ -4304,7 +4304,7 @@ static void parse_icap_service_failure_limit(Adaptation::Icap::Config *cfg) return; if (strcmp(token,"in") != 0) { - debugs(3, 0, "expecting 'in' on'" << config_input_line << "'"); + debugs(3, DBG_CRITICAL, "expecting 'in' on'" << config_input_line << "'"); self_destruct(); } @@ -4319,7 +4319,7 @@ static void parse_icap_service_failure_limit(Adaptation::Icap::Config *cfg) if (0 == d) (void) 0; else if ((token = strtok(NULL, w_space)) == NULL) { - debugs(3, 0, "No time-units on '" << config_input_line << "'"); + debugs(3, DBG_CRITICAL, "No time-units on '" << config_input_line << "'"); self_destruct(); } else if ((m = parseTimeUnits(token, false)) == 0) self_destruct(); diff --git a/src/client_db.cc b/src/client_db.cc index 03bc1ecc0b..63c6fce787 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -255,12 +255,12 @@ clientdbCutoffDenied(const Ip::Address &addr) if (p < 95.0) return 0; - debugs(1, 0, "WARNING: Probable misconfigured neighbor at " << key); + debugs(1, DBG_CRITICAL, "WARNING: Probable misconfigured neighbor at " << key); - debugs(1, 0, "WARNING: " << ND << " of the last " << NR << + debugs(1, DBG_CRITICAL, "WARNING: " << ND << " of the last " << NR << " ICP replies are DENIED"); - debugs(1, 0, "WARNING: No replies will be sent for the next " << + debugs(1, DBG_CRITICAL, "WARNING: No replies will be sent for the next " << CUTOFF_SECONDS << " seconds"); c->cutoff.time = squid_curtime; diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 5fa2f06b32..b55ad9fea8 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -300,7 +300,7 @@ clientReplyContext::processExpired() /* Register with storage manager to receive updates when data comes in. */ if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) - debugs(88, 0, "clientReplyContext::processExpired: Found ENTRY_ABORTED object"); + debugs(88, DBG_CRITICAL, "clientReplyContext::processExpired: Found ENTRY_ABORTED object"); { /* start counting the length from 0 */ @@ -623,8 +623,8 @@ clientReplyContext::processMiss() */ if (http->storeEntry()) { if (EBIT_TEST(http->storeEntry()->flags, ENTRY_SPECIAL)) { - debugs(88, 0, "clientProcessMiss: miss on a special object (" << url << ")."); - debugs(88, 0, "\tlog_type = " << Format::log_tags[http->logType]); + debugs(88, DBG_CRITICAL, "clientProcessMiss: miss on a special object (" << url << ")."); + debugs(88, DBG_CRITICAL, "\tlog_type = " << Format::log_tags[http->logType]); http->storeEntry()->dump(1); } diff --git a/src/comm/Connection.cc b/src/comm/Connection.cc index 222da0b6ec..c0e8a34739 100644 --- a/src/comm/Connection.cc +++ b/src/comm/Connection.cc @@ -27,8 +27,8 @@ static int64_t lost_conn = 0; Comm::Connection::~Connection() { if (fd >= 0) { - debugs(5, 0, "BUG: Orphan Comm::Connection: " << *this); - debugs(5, 0, "NOTE: " << ++lost_conn << " Orphans since last started."); + debugs(5, DBG_CRITICAL, "BUG: Orphan Comm::Connection: " << *this); + debugs(5, DBG_CRITICAL, "NOTE: " << ++lost_conn << " Orphans since last started."); close(); } diff --git a/src/comm/ModPoll.cc b/src/comm/ModPoll.cc index 758b99cfb5..fbce2143db 100644 --- a/src/comm/ModPoll.cc +++ b/src/comm/ModPoll.cc @@ -441,7 +441,7 @@ Comm::DoSelect(int msec) if (ignoreErrno(errno)) continue; - debugs(5, 0, "comm_poll: poll failure: " << xstrerror()); + debugs(5, DBG_CRITICAL, "comm_poll: poll failure: " << xstrerror()); assert(errno != EINVAL); @@ -539,19 +539,19 @@ Comm::DoSelect(int msec) if (revents & POLLNVAL) { AsyncCall::Pointer ch; - debugs(5, 0, "WARNING: FD " << fd << " has handlers, but it's invalid."); - debugs(5, 0, "FD " << fd << " is a " << fdTypeStr[F->type]); - debugs(5, 0, "--> " << F->desc); - debugs(5, 0, "tmout:" << F->timeoutHandler << "read:" << + debugs(5, DBG_CRITICAL, "WARNING: FD " << fd << " has handlers, but it's invalid."); + debugs(5, DBG_CRITICAL, "FD " << fd << " is a " << fdTypeStr[F->type]); + debugs(5, DBG_CRITICAL, "--> " << F->desc); + debugs(5, DBG_CRITICAL, "tmout:" << F->timeoutHandler << "read:" << F->read_handler << " write:" << F->write_handler); for (ch = F->closeHandler; ch != NULL; ch = ch->Next()) - debugs(5, 0, " close handler: " << ch); + debugs(5, DBG_CRITICAL, " close handler: " << ch); if (F->closeHandler != NULL) { commCallCloseHandlers(fd); } else if (F->timeoutHandler != NULL) { - debugs(5, 0, "comm_poll: Calling Timeout Handler"); + debugs(5, DBG_CRITICAL, "comm_poll: Calling Timeout Handler"); ScheduleCallHere(F->timeoutHandler); } diff --git a/src/comm/ModSelect.cc b/src/comm/ModSelect.cc index d5da9eccb0..bdfcd1b50e 100644 --- a/src/comm/ModSelect.cc +++ b/src/comm/ModSelect.cc @@ -459,7 +459,7 @@ Comm::DoSelect(int msec) if (ignoreErrno(errno)) break; - debugs(5, 0, "comm_select: select failure: " << xstrerror()); + debugs(5, DBG_CRITICAL, "comm_select: select failure: " << xstrerror()); examine_select(&readfds, &writefds); @@ -708,7 +708,7 @@ examine_select(fd_set * readfds, fd_set * writefds) fde *F = NULL; struct stat sb; - debugs(5, 0, "examine_select: Examining open file descriptors..."); + debugs(5, DBG_CRITICAL, "examine_select: Examining open file descriptors..."); for (fd = 0; fd < Squid_MaxFD; ++fd) { FD_ZERO(&read_x); @@ -731,18 +731,18 @@ examine_select(fd_set * readfds, fd_set * writefds) } F = &fd_table[fd]; - debugs(5, 0, "FD " << fd << ": " << xstrerror()); - debugs(5, 0, "WARNING: FD " << fd << " has handlers, but it's invalid."); - debugs(5, 0, "FD " << fd << " is a " << fdTypeStr[F->type] << " called '" << F->desc << "'"); - debugs(5, 0, "tmout:" << F->timeoutHandler << " read:" << F->read_handler << " write:" << F->write_handler); + debugs(5, DBG_CRITICAL, "FD " << fd << ": " << xstrerror()); + debugs(5, DBG_CRITICAL, "WARNING: FD " << fd << " has handlers, but it's invalid."); + debugs(5, DBG_CRITICAL, "FD " << fd << " is a " << fdTypeStr[F->type] << " called '" << F->desc << "'"); + debugs(5, DBG_CRITICAL, "tmout:" << F->timeoutHandler << " read:" << F->read_handler << " write:" << F->write_handler); for (ch = F->closeHandler; ch != NULL; ch = ch->Next()) - debugs(5, 0, " close handler: " << ch); + debugs(5, DBG_CRITICAL, " close handler: " << ch); if (F->closeHandler != NULL) { commCallCloseHandlers(fd); } else if (F->timeoutHandler != NULL) { - debugs(5, 0, "examine_select: Calling Timeout Handler"); + debugs(5, DBG_CRITICAL, "examine_select: Calling Timeout Handler"); ScheduleCallHere(F->timeoutHandler); } diff --git a/src/comm/ModSelectWin32.cc b/src/comm/ModSelectWin32.cc index 11149ddb3b..b7af3cc9d1 100644 --- a/src/comm/ModSelectWin32.cc +++ b/src/comm/ModSelectWin32.cc @@ -459,7 +459,7 @@ Comm::DoSelect(int msec) if (ignoreErrno(errno)) break; - debugs(5, 0, "comm_select: select failure: " << xstrerror()); + debugs(5, DBG_CRITICAL, "comm_select: select failure: " << xstrerror()); examine_select(&readfds, &writefds); @@ -728,7 +728,7 @@ examine_select(fd_set * readfds, fd_set * writefds) fde *F = NULL; struct stat sb; - debugs(5, 0, "examine_select: Examining open file descriptors..."); + debugs(5, DBG_CRITICAL, "examine_select: Examining open file descriptors..."); for (fd = 0; fd < Squid_MaxFD; ++fd) { FD_ZERO(&read_x); @@ -751,18 +751,18 @@ examine_select(fd_set * readfds, fd_set * writefds) } F = &fd_table[fd]; - debugs(5, 0, "FD " << fd << ": " << xstrerror()); - debugs(5, 0, "WARNING: FD " << fd << " has handlers, but it's invalid."); - debugs(5, 0, "FD " << fd << " is a " << fdTypeStr[F->type] << " called '" << F->desc << "'"); - debugs(5, 0, "tmout:" << F->timeoutHandler << " read:" << F->read_handler << " write:" << F->write_handler); + debugs(5, DBG_CRITICAL, "FD " << fd << ": " << xstrerror()); + debugs(5, DBG_CRITICAL, "WARNING: FD " << fd << " has handlers, but it's invalid."); + debugs(5, DBG_CRITICAL, "FD " << fd << " is a " << fdTypeStr[F->type] << " called '" << F->desc << "'"); + debugs(5, DBG_CRITICAL, "tmout:" << F->timeoutHandler << " read:" << F->read_handler << " write:" << F->write_handler); for (ch = F->closeHandler; ch != NULL; ch = ch->Next()) - debugs(5, 0, " close handler: " << ch); + debugs(5, DBG_CRITICAL, " close handler: " << ch); if (F->closeHandler != NULL) { commCallCloseHandlers(fd); } else if (F->timeoutHandler != NULL) { - debugs(5, 0, "examine_select: Calling Timeout Handler"); + debugs(5, DBG_CRITICAL, "examine_select: Calling Timeout Handler"); ScheduleCallHere(F->timeoutHandler); } diff --git a/src/debug.cc b/src/debug.cc index 64ab0ba925..2f0186cd74 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -561,7 +561,7 @@ debugLogKid(void) void xassert(const char *msg, const char *file, int line) { - debugs(0, 0, "assertion failed: " << file << ":" << line << ": \"" << msg << "\""); + debugs(0, DBG_CRITICAL, "assertion failed: " << file << ":" << line << ": \"" << msg << "\""); if (!shutting_down) abort(); @@ -670,7 +670,7 @@ ctx_enter(const char *descr) Ctx_Descrs[Ctx_Current_Level] = descr; if (Ctx_Current_Level == Ctx_Warn_Level) { - debugs(0, 0, "# ctx: suspiciously deep (" << Ctx_Warn_Level << ") nesting:"); + debugs(0, DBG_CRITICAL, "# ctx: suspiciously deep (" << Ctx_Warn_Level << ") nesting:"); Ctx_Warn_Level *= 2; } diff --git a/src/delay_pools.cc b/src/delay_pools.cc index f02348b2d0..758816e57a 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -672,7 +672,7 @@ void DelayPools::pools(unsigned short newPools) { if (pools()) { - debugs(3, 0, "parse_delay_pool_count: multiple delay_pools lines, aborting all previous delay_pools config"); + debugs(3, DBG_CRITICAL, "parse_delay_pool_count: multiple delay_pools lines, aborting all previous delay_pools config"); FreePools(); } diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 3df5433bed..69c3df79eb 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -258,14 +258,14 @@ idnsAddNameserver(const char *buf) Ip::Address A; if (!(A = buf)) { - debugs(78, 0, "WARNING: rejecting '" << buf << "' as a name server, because it is not a numeric IP address"); + debugs(78, DBG_CRITICAL, "WARNING: rejecting '" << buf << "' as a name server, because it is not a numeric IP address"); return; } if (A.IsAnyAddr()) { - debugs(78, 0, "WARNING: Squid does not accept " << A << " in DNS server specifications."); + debugs(78, DBG_CRITICAL, "WARNING: Squid does not accept " << A << " in DNS server specifications."); A.SetLocalhost(); - debugs(78, 0, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine"); + debugs(78, DBG_CRITICAL, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine"); } if (!Ip::EnableIpv6 && !A.SetIPv4()) { diff --git a/src/errorpage.cc b/src/errorpage.cc index a6efcdceb3..5aef7ed777 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1002,7 +1002,7 @@ ErrorState::Convert(char token, bool building_deny_info_url, bool allowRecursion /* for backward compat we make %s show the full URL. Drop this in some future release. */ if (building_deny_info_url) { p = request ? urlCanonical(request) : url; - debugs(0,0, "WARNING: deny_info now accepts coded tags. Use %u to get the full URL instead of %s"); + debugs(0, DBG_CRITICAL, "WARNING: deny_info now accepts coded tags. Use %u to get the full URL instead of %s"); } else p = visible_appname_string; break; diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index aa82678da8..e5967098b1 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -1199,13 +1199,13 @@ ESIContext::parserComment (const char *s) if (!tempParser->parse("
", 5,0) || !tempParser->parse(s + 3, strlen(s) - 3, 0) || !tempParser->parse("
",6,1)) { - debugs(86, 0, "ESIContext::parserComment: Parsing fragment '" << s + 3 << "' failed."); + debugs(86, DBG_CRITICAL, "ESIContext::parserComment: Parsing fragment '" << s + 3 << "' failed."); setError(); char tempstr[1024]; snprintf(tempstr, 1023, "ESIContext::parserComment: Parse error at line %ld:\n%s\n", tempParser->lineNumber(), tempParser->errorString()); - debugs(86, 0, "" << tempstr << ""); + debugs(86, DBG_CRITICAL, "" << tempstr << ""); setErrorMessage(tempstr); } @@ -1219,7 +1219,7 @@ ESIContext::parserComment (const char *s) len = strlen (s); if (len > sizeof (localbuf) - 9) { - debugs(86, 0, "ESIContext::parserComment: Truncating long comment"); + debugs(86, DBG_CRITICAL, "ESIContext::parserComment: Truncating long comment"); len = sizeof (localbuf) - 9; } @@ -1267,7 +1267,7 @@ ESIContext::parseOneBuffer() snprintf (tempstr, 1023, "esiProcess: Parse error at line %ld:\n%s\n", parserState.theParser->lineNumber(), parserState.theParser->errorString()); - debugs(86, 0, "" << tempstr << ""); + debugs(86, DBG_CRITICAL, "" << tempstr << ""); setErrorMessage(tempstr); @@ -1383,7 +1383,7 @@ ESIContext::process () break; case ESI_PROCESS_FAILED: - debugs(86, 0, "esiProcess: tree Processed FAILED"); + debugs(86, DBG_CRITICAL, "esiProcess: tree Processed FAILED"); setError(); setErrorMessage("esiProcess: ESI template Processing failed."); @@ -1787,12 +1787,12 @@ esiTry::process (int dovars) assert (this); if (!attempt.getRaw()) { - debugs(86, 0, "esiTryProcess: Try has no attempt element - ESI template is invalid (section 3.4)"); + debugs(86, DBG_CRITICAL, "esiTryProcess: Try has no attempt element - ESI template is invalid (section 3.4)"); return ESI_PROCESS_FAILED; } if (!except.getRaw()) { - debugs(86, 0, "esiTryProcess: Try has no except element - ESI template is invalid (section 3.4)"); + debugs(86, DBG_CRITICAL, "esiTryProcess: Try has no except element - ESI template is invalid (section 3.4)"); return ESI_PROCESS_FAILED; } @@ -2057,13 +2057,13 @@ esiChoose::addElement(ESIElement::Pointer element) /* Some elements require specific parents */ if (!(dynamic_cast(element.getRaw()) || dynamic_cast(element.getRaw()))) { - debugs(86, 0, "esiChooseAdd: invalid child node for esi:choose (section 3.3)"); + debugs(86, DBG_CRITICAL, "esiChooseAdd: invalid child node for esi:choose (section 3.3)"); return false; } if (dynamic_cast(element.getRaw())) { if (otherwise.getRaw()) { - debugs(86, 0, "esiChooseAdd: only one otherwise node allowed for esi:choose (section 3.3)"); + debugs(86, DBG_CRITICAL, "esiChooseAdd: only one otherwise node allowed for esi:choose (section 3.3)"); return false; } diff --git a/src/esi/Include.cc b/src/esi/Include.cc index f7337da13a..5ed666326b 100644 --- a/src/esi/Include.cc +++ b/src/esi/Include.cc @@ -342,7 +342,7 @@ ESIInclude::Start (ESIStreamContext::Pointer stream, char const *url, ESIVarStat "'"); if (clientBeginRequest(METHOD_GET, tempUrl, esiBufferRecipient, esiBufferDetach, stream.getRaw(), &tempheaders, stream->localbuffer->buf, HTTP_REQBUF_SZ)) { - debugs(86, 0, "starting new ESI subrequest failed"); + debugs(86, DBG_CRITICAL, "starting new ESI subrequest failed"); } tempheaders.clean(); diff --git a/src/esi/Sequence.cc b/src/esi/Sequence.cc index d1fbce1d3c..27ce3410d8 100644 --- a/src/esi/Sequence.cc +++ b/src/esi/Sequence.cc @@ -164,7 +164,7 @@ esiSequence::addElement (ESIElement::Pointer element) if (dynamic_cast(element.getRaw()) || dynamic_cast(element.getRaw())) { - debugs(86, 0, "esiSequenceAdd: misparented Attempt or Except element (section 3.4)"); + debugs(86, DBG_CRITICAL, "esiSequenceAdd: misparented Attempt or Except element (section 3.4)"); return false; } diff --git a/src/eui/Eui48.cc b/src/eui/Eui48.cc index 38e0746acb..7dc4977ca7 100644 --- a/src/eui/Eui48.cc +++ b/src/eui/Eui48.cc @@ -128,7 +128,7 @@ Eui::Eui48::decode(const char *asc) int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0; if (sscanf(asc, "%x:%x:%x:%x:%x:%x", &a1, &a2, &a3, &a4, &a5, &a6) != 6) { - debugs(28, 0, "Decode EUI-48: Invalid ethernet address '" << asc << "'"); + debugs(28, DBG_CRITICAL, "Decode EUI-48: Invalid ethernet address '" << asc << "'"); clear(); return false; /* This is not valid address */ } @@ -387,19 +387,19 @@ Eui::Eui48::lookup(const Ip::Address &c) mib[5] = RTF_LLINFO; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { - debugs(28, 0, "Can't estimate ARP table size!"); + debugs(28, DBG_CRITICAL, "Can't estimate ARP table size!"); clear(); return false; } if ((buf = (char *)xmalloc(needed)) == NULL) { - debugs(28, 0, "Can't allocate temporary ARP table!"); + debugs(28, DBG_CRITICAL, "Can't allocate temporary ARP table!"); clear(); return false; } if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { - debugs(28, 0, "Can't retrieve ARP table!"); + debugs(28, DBG_CRITICAL, "Can't retrieve ARP table!"); xfree(buf); clear(); return false; @@ -464,21 +464,21 @@ Eui::Eui48::lookup(const Ip::Address &c) /* Get size of Windows ARP table */ if (GetIpNetTable(NetTable, &ipNetTableLen, FALSE) != ERROR_INSUFFICIENT_BUFFER) { - debugs(28, 0, "Can't estimate ARP table size!"); + debugs(28, DBG_CRITICAL, "Can't estimate ARP table size!"); clear(); return false; } /* Allocate space for ARP table and assign pointers */ if ((NetTable = (PMIB_IPNETTABLE)xmalloc(ipNetTableLen)) == NULL) { - debugs(28, 0, "Can't allocate temporary ARP table!"); + debugs(28, DBG_CRITICAL, "Can't allocate temporary ARP table!"); clear(); return false; } /* Get actual ARP table */ if ((dwNetTable = GetIpNetTable(NetTable, &ipNetTableLen, FALSE)) != NO_ERROR) { - debugs(28, 0, "Can't retrieve ARP table!"); + debugs(28, DBG_CRITICAL, "Can't retrieve ARP table!"); xfree(NetTable); clear(); return false; @@ -516,7 +516,7 @@ Eui::Eui48::lookup(const Ip::Address &c) #else - debugs(28, 0, "ERROR: ARP / MAC / EUI-* operations not supported on this operating system."); + debugs(28, DBG_CRITICAL, "ERROR: ARP / MAC / EUI-* operations not supported on this operating system."); #endif /* diff --git a/src/eui/Eui64.cc b/src/eui/Eui64.cc index 18b9995da4..0f96947d36 100644 --- a/src/eui/Eui64.cc +++ b/src/eui/Eui64.cc @@ -68,7 +68,7 @@ Eui::Eui64::lookupNdp(const Ip::Address &c) #if 0 /* no actual lookup coded yet */ /* no OS yet supported for NDP protocol lookup */ - debugs(28, 0, "ERROR: ARP / MAC / EUI-* operations not supported on this operating system."); + debugs(28, DBG_CRITICAL, "ERROR: ARP / MAC / EUI-* operations not supported on this operating system."); /* * Address was not found on any interface diff --git a/src/external_acl.cc b/src/external_acl.cc index d611c47882..4f3ecee0c3 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -341,7 +341,7 @@ parse_externalAclHelper(external_acl ** list) a->negative_ttl = atoi(token + 13); } else if (strncmp(token, "children=", 9) == 0) { a->children.n_max = atoi(token + 9); - debugs(0, 0, "WARNING: external_acl_type option children=N has been deprecated in favor of children-max=N and children-startup=N"); + debugs(0, DBG_CRITICAL, "WARNING: external_acl_type option children=N has been deprecated in favor of children-max=N and children-startup=N"); } else if (strncmp(token, "children-max=", 13) == 0) { a->children.n_max = atoi(token + 13); } else if (strncmp(token, "children-startup=", 17) == 0) { @@ -367,11 +367,11 @@ parse_externalAclHelper(external_acl ** list) bind to IPv4/v6 localhost port. */ } else if (strcmp(token, "ipv4") == 0) { if ( !a->local_addr.SetIPv4() ) { - debugs(3, 0, "WARNING: Error converting " << a->local_addr << " to IPv4 in " << a->name ); + debugs(3, DBG_CRITICAL, "WARNING: Error converting " << a->local_addr << " to IPv4 in " << a->name ); } } else if (strcmp(token, "ipv6") == 0) { if (!Ip::EnableIpv6) - debugs(3, 0, "WARNING: --enable-ipv6 required for external ACL helpers to use IPv6: " << a->name ); + debugs(3, DBG_CRITICAL, "WARNING: --enable-ipv6 required for external ACL helpers to use IPv6: " << a->name ); // else nothing to do. } else { break; @@ -478,7 +478,7 @@ parse_externalAclHelper(external_acl ** list) else if (strcmp(token, "%%") == 0) format->type = _external_acl_format::EXT_ACL_PERCENT; else { - debugs(0,0, "ERROR: Unknown Format token " << token); + debugs(0, DBG_CRITICAL, "ERROR: Unknown Format token " << token); self_destruct(); } @@ -717,12 +717,12 @@ ACLExternal::valid () const #if USE_AUTH if (data->def->require_auth) { if (authenticateSchemeCount() == 0) { - debugs(28, 0, "Can't use proxy auth because no authentication schemes were compiled."); + debugs(28, DBG_CRITICAL, "Can't use proxy auth because no authentication schemes were compiled."); return false; } if (authenticateActiveSchemeCount() == 0) { - debugs(28, 0, "Can't use proxy auth because no authentication schemes are fully configured."); + debugs(28, DBG_CRITICAL, "Can't use proxy auth because no authentication schemes are fully configured."); return false; } } diff --git a/src/fd.cc b/src/fd.cc index 4f3fc0780d..e828e1b09c 100644 --- a/src/fd.cc +++ b/src/fd.cc @@ -362,13 +362,13 @@ fdAdjustReserved(void) if (newReserve > x) { /* perhaps this should be fatal()? -DW */ - debugs(51, 0, "WARNING: This machine has a serious shortage of filedescriptors."); + debugs(51, DBG_CRITICAL, "WARNING: This machine has a serious shortage of filedescriptors."); newReserve = x; } if (Squid_MaxFD - newReserve < min(256, Squid_MaxFD / 2)) fatalf("Too few filedescriptors available in the system (%d usable of %d).\n", Squid_MaxFD - newReserve, Squid_MaxFD); - debugs(51, 0, "Reserved FD adjusted from " << RESERVED_FD << " to " << newReserve << " due to failures"); + debugs(51, DBG_CRITICAL, "Reserved FD adjusted from " << RESERVED_FD << " to " << newReserve << " due to failures"); RESERVED_FD = newReserve; } diff --git a/src/format/Config.cc b/src/format/Config.cc index 991bcc45d4..b81b718892 100644 --- a/src/format/Config.cc +++ b/src/format/Config.cc @@ -39,5 +39,5 @@ Format::FmtConfig::registerTokens(const String &nsName, TokenTableEntry const *t if (tokenArray != NULL) tokens.push_back(TokenNamespace(nsName, tokenArray)); else - debugs(0,0, "BUG: format tokens for '" << nsName << "' missing!"); + debugs(0, DBG_CRITICAL, "BUG: format tokens for '" << nsName << "' missing!"); } diff --git a/src/format/Token.cc b/src/format/Token.cc index 4922099bee..bf18b7a3e2 100644 --- a/src/format/Token.cc +++ b/src/format/Token.cc @@ -526,28 +526,28 @@ done: break; case LFT_HTTP_SENT_STATUS_CODE_OLD_30: - debugs(46, 0, "WARNING: The \"Hs\" formatting code is deprecated. Use the \">Hs\" instead."); + debugs(46, DBG_CRITICAL, "WARNING: The \"Hs\" formatting code is deprecated. Use the \">Hs\" instead."); type = LFT_HTTP_SENT_STATUS_CODE; break; case LFT_SERVER_LOCAL_IP_OLD_27: - debugs(46, 0, "WARNING: The \"oa\" formatting code is deprecated. Use the \"rp\" instead."); + debugs(46, DBG_CRITICAL, "WARNING: The \"rp\" formatting code is deprecated. Use the \">rp\" instead."); type = LFT_CLIENT_REQ_URLPATH; break; case LFT_REQUEST_VERSION_OLD_2X: - debugs(46, 0, "WARNING: The \">v\" formatting code is deprecated. Use the \">rv\" instead."); + debugs(46, DBG_CRITICAL, "WARNING: The \">v\" formatting code is deprecated. Use the \">rv\" instead."); type = LFT_REQUEST_VERSION; break; #if !USE_SQUID_EUI case LFT_CLIENT_EUI: - debugs(46, 0, "WARNING: The \">eui\" formatting code requires EUI features which are disabled in this Squid."); + debugs(46, DBG_CRITICAL, "WARNING: The \">eui\" formatting code requires EUI features which are disabled in this Squid."); break; #endif diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 663c3dd61a..ffd78f74da 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -648,7 +648,7 @@ storeCossDirOpenTmpSwapLog(CossSwapDir * sd, int *clean_flag, int *zero_flag) fp = fopen(swaplog_path, "rb"); if (fp == NULL) { - debugs(50, 0, "" << swaplog_path << ": " << xstrerror()); + debugs(50, DBG_CRITICAL, "" << swaplog_path << ": " << xstrerror()); fatal("Failed to open swap log for reading"); } @@ -782,8 +782,8 @@ CossCleanLog::write(StoreEntry const &e) if (outbuf_offset + ss > CLEAN_BUF_SZ) { if (FD_WRITE_METHOD(fd, outbuf, outbuf_offset) < 0) { - debugs(50, 0, "storeCossDirWriteCleanLogs: " << newLog << ": write: " << xstrerror()); - debugs(50, 0, "storeCossDirWriteCleanLogs: Current swap logfile not replaced."); + debugs(50, DBG_CRITICAL, "storeCossDirWriteCleanLogs: " << newLog << ": write: " << xstrerror()); + debugs(50, DBG_CRITICAL, "storeCossDirWriteCleanLogs: Current swap logfile not replaced."); file_close(fd); fd = -1; unlink(newLog); @@ -808,8 +808,8 @@ CossSwapDir::writeCleanDone() return; if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) { - debugs(50, 0, "storeCossDirWriteCleanLogs: " << state->newLog << ": write: " << xstrerror()); - debugs(50, 0, "storeCossDirWriteCleanLogs: Current swap logfile not replaced."); + debugs(50, DBG_CRITICAL, "storeCossDirWriteCleanLogs: " << state->newLog << ": write: " << xstrerror()); + debugs(50, DBG_CRITICAL, "storeCossDirWriteCleanLogs: Current swap logfile not replaced."); file_close(state->fd); state->fd = -1; ::unlink(state->newLog); @@ -1027,9 +1027,9 @@ CossSwapDir::parse(int anIndex, char *aPath) const uint64_t max_offset = (uint64_t)SwapFilenMax << blksz_bits; if (maxSize() > max_offset) { - debugs(47, 0, "COSS block-size = " << (1<error()) { tryClosing(); diff --git a/src/helper.cc b/src/helper.cc index 750b8f3aaf..a6f2b92892 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -277,7 +277,7 @@ helperStatefulOpenServers(statefulhelper * hlp) return; if (hlp->childs.concurrency) - debugs(84, 0, "ERROR: concurrency= is not yet supported for stateful helpers ('" << hlp->cmdline << "')"); + debugs(84, DBG_CRITICAL, "ERROR: concurrency= is not yet supported for stateful helpers ('" << hlp->cmdline << "')"); char *progname = hlp->cmdline->key; @@ -680,7 +680,7 @@ helper::~helper() /* note, don't free id_name, it probably points to static memory */ if (queue.head) - debugs(84, 0, "WARNING: freeing " << id_name << " helper with " << stats.queue_size << " requests queued"); + debugs(84, DBG_CRITICAL, "WARNING: freeing " << id_name << " helper with " << stats.queue_size << " requests queued"); } /* ====================================================================== */ @@ -783,7 +783,7 @@ helperStatefulServerFree(helper_stateful_server *srv) if (!srv->flags.shutdown) { assert( hlp->childs.n_active > 0); -- hlp->childs.n_active; - debugs(84, 0, "WARNING: " << hlp->id_name << " #" << srv->index + 1 << " exited"); + debugs(84, DBG_CRITICAL, "WARNING: " << hlp->id_name << " #" << srv->index + 1 << " exited"); if (hlp->childs.needNew() > 0) { debugs(80, DBG_IMPORTANT, "Too few " << hlp->id_name << " processes are running (need " << hlp->childs.needNew() << "/" << hlp->childs.n_max << ")"); @@ -1058,7 +1058,7 @@ Enqueue(helper * hlp, helper_request * r) /* do this first so idle=N has a chance to grow the child pool before it hits critical. */ if (hlp->childs.needNew() > 0) { - debugs(84, 0, "Starting new " << hlp->id_name << " helpers..."); + debugs(84, DBG_CRITICAL, "Starting new " << hlp->id_name << " helpers..."); helperOpenServers(hlp); return; } @@ -1074,9 +1074,9 @@ Enqueue(helper * hlp, helper_request * r) hlp->last_queue_warn = squid_curtime; - debugs(84, 0, "WARNING: All " << hlp->childs.n_active << "/" << hlp->childs.n_max << " " << hlp->id_name << " processes are busy."); - debugs(84, 0, "WARNING: " << hlp->stats.queue_size << " pending requests queued"); - debugs(84, 0, "WARNING: Consider increasing the number of " << hlp->id_name << " processes in your config file."); + debugs(84, DBG_CRITICAL, "WARNING: All " << hlp->childs.n_active << "/" << hlp->childs.n_max << " " << hlp->id_name << " processes are busy."); + debugs(84, DBG_CRITICAL, "WARNING: " << hlp->stats.queue_size << " pending requests queued"); + debugs(84, DBG_CRITICAL, "WARNING: Consider increasing the number of " << hlp->id_name << " processes in your config file."); if (hlp->stats.queue_size > (int)hlp->childs.n_running * 2) fatalf("Too many queued %s requests", hlp->id_name); @@ -1091,7 +1091,7 @@ StatefulEnqueue(statefulhelper * hlp, helper_stateful_request * r) /* do this first so idle=N has a chance to grow the child pool before it hits critical. */ if (hlp->childs.needNew() > 0) { - debugs(84, 0, "Starting new " << hlp->id_name << " helpers..."); + debugs(84, DBG_CRITICAL, "Starting new " << hlp->id_name << " helpers..."); helperStatefulOpenServers(hlp); return; } @@ -1110,9 +1110,9 @@ StatefulEnqueue(statefulhelper * hlp, helper_stateful_request * r) hlp->last_queue_warn = squid_curtime; - debugs(84, 0, "WARNING: All " << hlp->childs.n_active << "/" << hlp->childs.n_max << " " << hlp->id_name << " processes are busy."); - debugs(84, 0, "WARNING: " << hlp->stats.queue_size << " pending requests queued"); - debugs(84, 0, "WARNING: Consider increasing the number of " << hlp->id_name << " processes in your config file."); + debugs(84, DBG_CRITICAL, "WARNING: All " << hlp->childs.n_active << "/" << hlp->childs.n_max << " " << hlp->id_name << " processes are busy."); + debugs(84, DBG_CRITICAL, "WARNING: " << hlp->stats.queue_size << " pending requests queued"); + debugs(84, DBG_CRITICAL, "WARNING: Consider increasing the number of " << hlp->id_name << " processes in your config file."); } static helper_request * @@ -1240,7 +1240,7 @@ helperDispatchWriteDone(const Comm::ConnectionPointer &conn, char *buf, size_t l if (flag != COMM_OK) { /* Helper server has crashed */ - debugs(84, 0, "helperDispatch: Helper " << srv->parent->id_name << " #" << srv->index + 1 << " has crashed"); + debugs(84, DBG_CRITICAL, "helperDispatch: Helper " << srv->parent->id_name << " #" << srv->index + 1 << " has crashed"); return; } diff --git a/src/icmp/Icmp4.cc b/src/icmp/Icmp4.cc index 30e87fd552..704b690d12 100644 --- a/src/icmp/Icmp4.cc +++ b/src/icmp/Icmp4.cc @@ -79,7 +79,7 @@ Icmp4::Open(void) icmp_sock = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP); if (icmp_sock < 0) { - debugs(50, 0, HERE << " icmp_sock: " << xstrerror()); + debugs(50, DBG_CRITICAL, HERE << " icmp_sock: " << xstrerror()); return -1; } @@ -172,7 +172,7 @@ Icmp4::Recv(void) static pingerReplyData preply; if (icmp_sock < 0) { - debugs(42, 0, HERE << "No socket! Recv() should not be called."); + debugs(42, DBG_CRITICAL, HERE << "No socket! Recv() should not be called."); return; } diff --git a/src/icmp/Icmp6.cc b/src/icmp/Icmp6.cc index 69434fbcdc..3a245a56b1 100644 --- a/src/icmp/Icmp6.cc +++ b/src/icmp/Icmp6.cc @@ -119,7 +119,7 @@ Icmp6::Open(void) icmp_sock = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6); if (icmp_sock < 0) { - debugs(50, 0, HERE << " icmp_sock: " << xstrerror()); + debugs(50, DBG_CRITICAL, HERE << " icmp_sock: " << xstrerror()); return -1; } @@ -220,7 +220,7 @@ Icmp6::Recv(void) static pingerReplyData preply; if (icmp_sock < 0) { - debugs(42,0, HERE << "dropping ICMPv6 read. No socket!?"); + debugs(42, DBG_CRITICAL, HERE << "dropping ICMPv6 read. No socket!?"); return; } @@ -271,7 +271,7 @@ Icmp6::Recv(void) ip = (struct ip6_hdr *) pkt; pkt += sizeof(ip6_hdr); - debugs(42,0, HERE << "ip6_nxt=" << ip->ip6_nxt << + debugs(42, DBG_CRITICAL, HERE << "ip6_nxt=" << ip->ip6_nxt << ", ip6_plen=" << ip->ip6_plen << ", ip6_hlim=" << ip->ip6_hlim << ", ip6_hops=" << ip->ip6_hops << diff --git a/src/icmp/IcmpPinger.cc b/src/icmp/IcmpPinger.cc index 49a56e2c63..dc25ed9bc9 100644 --- a/src/icmp/IcmpPinger.cc +++ b/src/icmp/IcmpPinger.cc @@ -88,7 +88,7 @@ IcmpPinger::Open(void) if (x < (int)sizeof(wpi)) { getCurrentTime(); - debugs(42, 0, HERE << "read: FD 0: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << "read: FD 0: " << xstrerror()); write(1, "ERR\n", 4); return -1; } @@ -100,7 +100,7 @@ IcmpPinger::Open(void) if (x < (int)sizeof(PS)) { getCurrentTime(); - debugs(42, 0, HERE << "read: FD 0: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << "read: FD 0: " << xstrerror()); write(1, "ERR\n", 4); return -1; } @@ -111,7 +111,7 @@ IcmpPinger::Open(void) if (icmp_sock == -1) { getCurrentTime(); - debugs(42, 0, HERE << "WSASocket: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << "WSASocket: " << xstrerror()); write(1, "ERR\n", 4); return -1; } @@ -120,7 +120,7 @@ IcmpPinger::Open(void) if (SOCKET_ERROR == x) { getCurrentTime(); - debugs(42, 0, HERE << "connect: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << "connect: " << xstrerror()); write(1, "ERR\n", 4); return -1; } @@ -130,14 +130,14 @@ IcmpPinger::Open(void) x = recv(icmp_sock, (void *) buf, sizeof(buf), 0); if (x < 3) { - debugs(42, 0, HERE << "recv: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << "recv: " << xstrerror()); return -1; } x = send(icmp_sock, (const void *) buf, strlen(buf), 0); if (x < 3 || strncmp("OK\n", buf, 3)) { - debugs(42, 0, HERE << "recv: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << "recv: " << xstrerror()); return -1; } @@ -192,7 +192,7 @@ IcmpPinger::Recv(void) if (0 == n) { /* EOF indicator */ - debugs(42, 0, HERE << "EOF encountered. Pinger exiting.\n"); + debugs(42, DBG_CRITICAL, HERE << "EOF encountered. Pinger exiting.\n"); errno = 0; Close(); exit(1); @@ -233,7 +233,7 @@ IcmpPinger::SendResult(pingerReplyData &preply, int len) debugs(42, 2, HERE << "return result to squid. len=" << len); if (send(socket_to_squid, &preply, len, 0) < 0) { - debugs(42, 0, "pinger: FATAL error on send: " << xstrerror()); + debugs(42, DBG_CRITICAL, "pinger: FATAL error on send: " << xstrerror()); Close(); exit(1); } diff --git a/src/icmp/IcmpSquid.cc b/src/icmp/IcmpSquid.cc index 6337c1a898..4ff85a9ff6 100644 --- a/src/icmp/IcmpSquid.cc +++ b/src/icmp/IcmpSquid.cc @@ -294,7 +294,7 @@ IcmpSquid::Close(void) if (hIpc) { if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) { getCurrentTime(); - debugs(37, 0, HERE << "WARNING: (pinger," << pid << ") didn't exit in 12 seconds"); + debugs(37, DBG_CRITICAL, HERE << "WARNING: (pinger," << pid << ") didn't exit in 12 seconds"); } CloseHandle(hIpc); diff --git a/src/icmp/net_db.cc b/src/icmp/net_db.cc index d27d0ee282..6ca9c9d0e0 100644 --- a/src/icmp/net_db.cc +++ b/src/icmp/net_db.cc @@ -1024,7 +1024,7 @@ netdbDump(StoreEntry * sentry) } if (i != memInUse(MEM_NETDBENTRY)) - debugs(38, 0, "WARNING: netdb_addrs count off, found " << i << + debugs(38, DBG_CRITICAL, "WARNING: netdb_addrs count off, found " << i << ", expected " << memInUse(MEM_NETDBENTRY)); qsort((char *) list, diff --git a/src/icmp/pinger.cc b/src/icmp/pinger.cc index 1bbefdd122..539115259c 100644 --- a/src/icmp/pinger.cc +++ b/src/icmp/pinger.cc @@ -150,30 +150,30 @@ main(int argc, char *argv[]) _db_init(NULL, debug_args); - debugs(42, 0, "pinger: Initialising ICMP pinger ..."); + debugs(42, DBG_CRITICAL, "pinger: Initialising ICMP pinger ..."); icmp4_worker = icmp4.Open(); if (icmp4_worker < 0) { - debugs(42, 0, "pinger: Unable to start ICMP pinger."); + debugs(42, DBG_CRITICAL, "pinger: Unable to start ICMP pinger."); } max_fd = max(max_fd, icmp4_worker); #if USE_IPV6 icmp6_worker = icmp6.Open(); if (icmp6_worker <0 ) { - debugs(42, 0, "pinger: Unable to start ICMPv6 pinger."); + debugs(42, DBG_CRITICAL, "pinger: Unable to start ICMPv6 pinger."); } max_fd = max(max_fd, icmp6_worker); #endif /** abort if neither worker could open a socket. */ if (icmp4_worker < 0 && icmp6_worker < 0) { - debugs(42, 0, "FATAL: pinger: Unable to open any ICMP sockets."); + debugs(42, DBG_CRITICAL, "FATAL: pinger: Unable to open any ICMP sockets."); exit(1); } if ( (squid_link = control.Open()) < 0) { - debugs(42, 0, "FATAL: pinger: Unable to setup Pinger control sockets."); + debugs(42, DBG_CRITICAL, "FATAL: pinger: Unable to setup Pinger control sockets."); icmp4.Close(); icmp6.Close(); exit(1); // fatal error if the control channel fails. @@ -201,7 +201,7 @@ main(int argc, char *argv[]) getCurrentTime(); if (x < 0) { - debugs(42, 0, HERE << " FATAL Shutdown. select()==" << x << ", ERR: " << xstrerror()); + debugs(42, DBG_CRITICAL, HERE << " FATAL Shutdown. select()==" << x << ", ERR: " << xstrerror()); control.Close(); exit(1); } @@ -219,7 +219,7 @@ main(int argc, char *argv[]) if (PINGER_TIMEOUT + last_check_time < squid_curtime) { if (send(LINK_TO_SQUID, &tv, 0, 0) < 0) { - debugs(42, 0, "pinger: Closing. No requests in last " << PINGER_TIMEOUT << " seconds."); + debugs(42, DBG_CRITICAL, "pinger: Closing. No requests in last " << PINGER_TIMEOUT << " seconds."); control.Close(); exit(1); } diff --git a/src/icp_v2.cc b/src/icp_v2.cc index a01b5d335f..3b32688bd9 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -506,8 +506,8 @@ void _icp_common_t::handleReply(char *buf, Ip::Address &from) { if (neighbors_do_private_keys && reqnum == 0) { - debugs(12, 0, "icpHandleIcpV2: Neighbor " << from << " returned reqnum = 0"); - debugs(12, 0, "icpHandleIcpV2: Disabling use of private keys"); + debugs(12, DBG_CRITICAL, "icpHandleIcpV2: Neighbor " << from << " returned reqnum = 0"); + debugs(12, DBG_CRITICAL, "icpHandleIcpV2: Disabling use of private keys"); neighbors_do_private_keys = 0; } @@ -562,7 +562,7 @@ icpHandleIcpV2(int fd, Ip::Address &from, char *buf, int len) break; default: - debugs(12, 0, "icpHandleIcpV2: UNKNOWN OPCODE: " << header.opcode << " from " << from); + debugs(12, DBG_CRITICAL, "icpHandleIcpV2: UNKNOWN OPCODE: " << header.opcode << " from " << from); break; } diff --git a/src/icp_v3.cc b/src/icp_v3.cc index 2caa62e41b..a86203dd00 100644 --- a/src/icp_v3.cc +++ b/src/icp_v3.cc @@ -150,7 +150,7 @@ icpHandleIcpV3(int fd, Ip::Address &from, char *buf, int len) break; default: - debugs(12, 0, "icpHandleIcpV3: UNKNOWN OPCODE: " << header.opcode << " from " << from); + debugs(12, DBG_CRITICAL, "icpHandleIcpV3: UNKNOWN OPCODE: " << header.opcode << " from " << from); break; } } diff --git a/src/ip/Address.cc b/src/ip/Address.cc index 29d3d1fa8d..aff975f835 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -353,7 +353,7 @@ Ip::Address::GetReverseString(char buf[MAX_IPSTRLEN], int show_type) const return GetReverseString6(buf, m_SocketAddr.sin6_addr); } - debugs(14,0, "Unable to convert '" << NtoA(buf,MAX_IPSTRLEN) << "' to the rDNS type requested."); + debugs(14, DBG_CRITICAL, "Unable to convert '" << NtoA(buf,MAX_IPSTRLEN) << "' to the rDNS type requested."); buf[0] = '\0'; @@ -858,7 +858,7 @@ Ip::Address::NtoA(char* buf, const unsigned int blen, int force) const GetInAddr(tmp); inet_ntop(AF_INET, &tmp, buf, blen); } else { - debugs(14,0,"WARNING: Corrupt IP Address details OR required to display in unknown format (" << + debugs(14, DBG_CRITICAL, "WARNING: Corrupt IP Address details OR required to display in unknown format (" << force << "). accepted={" << AF_UNSPEC << "," << AF_INET << "," << AF_INET6 << "}"); fprintf(stderr,"WARNING: Corrupt IP Address details OR required to display in unknown format (%d). accepted={%d,%d,%d} ", force, AF_UNSPEC, AF_INET, AF_INET6); diff --git a/src/ipc.cc b/src/ipc.cc index 10c0419cce..a44231ebf6 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -138,14 +138,14 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name int c2p[2]; if (pipe(p2c) < 0) { - debugs(54, 0, "ipcCreate: pipe: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: pipe: " << xstrerror()); return -1; // maybe ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } fd_open(prfd = p2c[0], FD_PIPE, "IPC FIFO Parent Read"); fd_open(cwfd = p2c[1], FD_PIPE, "IPC FIFO Child Write"); if (pipe(c2p) < 0) { - debugs(54, 0, "ipcCreate: pipe: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: pipe: " << xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } fd_open(crfd = c2p[0], FD_PIPE, "IPC FIFO Child Read"); @@ -161,7 +161,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name int buflen = 32768; if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { - debugs(54, 0, "ipcCreate: socketpair: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: socketpair: " << xstrerror()); return -1; } @@ -178,7 +178,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name int fds[2]; if (socketpair(AF_UNIX, SOCK_DGRAM, 0, fds) < 0) { - debugs(54, 0, "ipcCreate: socketpair: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: socketpair: " << xstrerror()); return -1; } @@ -203,7 +203,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name if (getsockname(pwfd, AI->ai_addr, &AI->ai_addrlen) < 0) { PaS.FreeAddrInfo(AI); - debugs(54, 0, "ipcCreate: getsockname: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } @@ -217,7 +217,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name if (getsockname(crfd, AI->ai_addr, &AI->ai_addrlen) < 0) { ChS.FreeAddrInfo(AI); - debugs(54, 0, "ipcCreate: getsockname: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } @@ -268,13 +268,13 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name x = read(prfd, hello_buf, HELLO_BUF_SZ - 1); if (x < 0) { - debugs(54, 0, "ipcCreate: PARENT: hello read test failed"); - debugs(54, 0, "--> read: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: hello read test failed"); + debugs(54, DBG_CRITICAL, "--> read: " << xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } else if (strcmp(hello_buf, hello_string)) { - debugs(54, 0, "ipcCreate: PARENT: hello read test failed"); - debugs(54, 0, "--> read returned " << x); - debugs(54, 0, "--> got '" << rfc1738_escape(hello_buf) << "'"); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: hello read test failed"); + debugs(54, DBG_CRITICAL, "--> read returned " << x); + debugs(54, DBG_CRITICAL, "--> got '" << rfc1738_escape(hello_buf) << "'"); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } @@ -319,7 +319,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name debugs(54, 3, "ipcCreate: calling accept on FD " << crfd); if ((fd = accept(crfd, NULL, NULL)) < 0) { - debugs(54, 0, "ipcCreate: FD " << crfd << " accept: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: FD " << crfd << " accept: " << xstrerror()); _exit(1); } @@ -335,14 +335,14 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name x = comm_udp_send(cwfd, hello_string, strlen(hello_string) + 1, 0); if (x < 0) { - debugs(54, 0, "sendto FD " << cwfd << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: hello write test failed"); + debugs(54, DBG_CRITICAL, "sendto FD " << cwfd << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: hello write test failed"); _exit(1); } } else { if (write(cwfd, hello_string, strlen(hello_string) + 1) < 0) { - debugs(54, 0, "write FD " << cwfd << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: hello write test failed"); + debugs(54, DBG_CRITICAL, "write FD " << cwfd << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: hello write test failed"); _exit(1); } } @@ -400,7 +400,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name debug_log = fdopen(2, "a+"); - debugs(54, 0, "ipcCreate: " << prog << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: " << prog << ": " << xstrerror()); _exit(1); diff --git a/src/ipc_win32.cc b/src/ipc_win32.cc index 6148d7d742..60223f7390 100644 --- a/src/ipc_win32.cc +++ b/src/ipc_win32.cc @@ -167,7 +167,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name 0, name); } else if (type == IPC_FIFO) { - debugs(54, 0, "ipcCreate: " << prog << ": use IPC_TCP_SOCKET instead of IP_FIFO on Windows"); + debugs(54, DBG_CRITICAL, "ipcCreate: " << prog << ": use IPC_TCP_SOCKET instead of IP_FIFO on Windows"); assert(0); } else { assert(IPC_NONE); @@ -185,12 +185,12 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name } if (crfd < 0) { - debugs(54, 0, "ipcCreate: Failed to create child FD."); + debugs(54, DBG_CRITICAL, "ipcCreate: Failed to create child FD."); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } if (pwfd < 0) { - debugs(54, 0, "ipcCreate: Failed to create server FD."); + debugs(54, DBG_CRITICAL, "ipcCreate: Failed to create server FD."); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } @@ -200,7 +200,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name tmp_addr.InitAddrInfo(aiPS); if (getsockname(pwfd, aiPS->ai_addr, &(aiPS->ai_addrlen) ) < 0) { - debugs(54, 0, "ipcCreate: getsockname: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } @@ -211,7 +211,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name tmp_addr.InitAddrInfo(aiCS); if (getsockname(crfd, aiCS->ai_addr, &(aiCS->ai_addrlen) ) < 0) { - debugs(54, 0, "ipcCreate: getsockname: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerror()); return ipcCloseAllFD(prfd, pwfd, crfd, cwfd); } @@ -264,14 +264,14 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name x = recv(prfd, (void *)hello_buf, HELLO_BUF_SZ - 1, 0); if (x < 0) { - debugs(54, 0, "ipcCreate: PARENT: hello read test failed"); - debugs(54, 0, "--> read: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: hello read test failed"); + debugs(54, DBG_CRITICAL, "--> read: " << xstrerror()); CloseHandle((HANDLE) thread); return ipcCloseAllFD(prfd, pwfd, -1, -1); } else if (strcmp(hello_buf, hello_string)) { - debugs(54, 0, "ipcCreate: PARENT: hello read test failed"); - debugs(54, 0, "--> read returned " << x); - debugs(54, 0, "--> got '" << rfc1738_escape(hello_buf) << "'"); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: hello read test failed"); + debugs(54, DBG_CRITICAL, "--> read returned " << x); + debugs(54, DBG_CRITICAL, "--> got '" << rfc1738_escape(hello_buf) << "'"); CloseHandle((HANDLE) thread); return ipcCloseAllFD(prfd, pwfd, -1, -1); } @@ -279,8 +279,8 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name x = send(pwfd, (const void *)ok_string, strlen(ok_string), 0); if (x < 0) { - debugs(54, 0, "ipcCreate: PARENT: OK write test failed"); - debugs(54, 0, "--> read: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: OK write test failed"); + debugs(54, DBG_CRITICAL, "--> read: " << xstrerror()); CloseHandle((HANDLE) thread); return ipcCloseAllFD(prfd, pwfd, -1, -1); } @@ -289,14 +289,14 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name x = recv(prfd, (void *)hello_buf, HELLO_BUF_SZ - 1, 0); if (x < 0) { - debugs(54, 0, "ipcCreate: PARENT: OK read test failed"); - debugs(54, 0, "--> read: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: OK read test failed"); + debugs(54, DBG_CRITICAL, "--> read: " << xstrerror()); CloseHandle((HANDLE) thread); return ipcCloseAllFD(prfd, pwfd, -1, -1); } else if (!strcmp(hello_buf, err_string)) { - debugs(54, 0, "ipcCreate: PARENT: OK read test failed"); - debugs(54, 0, "--> read returned " << x); - debugs(54, 0, "--> got '" << rfc1738_escape(hello_buf) << "'"); + debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: OK read test failed"); + debugs(54, DBG_CRITICAL, "--> read returned " << x); + debugs(54, DBG_CRITICAL, "--> got '" << rfc1738_escape(hello_buf) << "'"); CloseHandle((HANDLE) thread); return ipcCloseAllFD(prfd, pwfd, -1, -1); } @@ -353,8 +353,8 @@ ipcSend(int cwfd, const char *buf, int len) x = send(cwfd, (const void *)buf, len, 0); if (x < 0) { - debugs(54, 0, "sendto FD " << cwfd << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: hello write test failed"); + debugs(54, DBG_CRITICAL, "sendto FD " << cwfd << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: hello write test failed"); } return x; @@ -409,7 +409,7 @@ ipc_thread_1(void *in_params) debugs(54, 3, "ipcCreate: calling accept on FD " << crfd); if ((fd = accept(crfd, NULL, NULL)) < 0) { - debugs(54, 0, "ipcCreate: FD " << crfd << " accept: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: FD " << crfd << " accept: " << xstrerror()); goto cleanup; } @@ -427,8 +427,8 @@ ipc_thread_1(void *in_params) x = send(cwfd, (const void *)hello_string, strlen(hello_string) + 1, 0); if (x < 0) { - debugs(54, 0, "sendto FD " << cwfd << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: hello write test failed"); + debugs(54, DBG_CRITICAL, "sendto FD " << cwfd << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: hello write test failed"); goto cleanup; } @@ -437,25 +437,25 @@ ipc_thread_1(void *in_params) x = recv(crfd, (void *)buf1, 8191, 0); if (x < 0) { - debugs(54, 0, "ipcCreate: CHILD: OK read test failed"); - debugs(54, 0, "--> read: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: OK read test failed"); + debugs(54, DBG_CRITICAL, "--> read: " << xstrerror()); goto cleanup; } else if (strcmp(buf1, ok_string)) { - debugs(54, 0, "ipcCreate: CHILD: OK read test failed"); - debugs(54, 0, "--> read returned " << x); - debugs(54, 0, "--> got '" << rfc1738_escape(hello_buf) << "'"); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: OK read test failed"); + debugs(54, DBG_CRITICAL, "--> read returned " << x); + debugs(54, DBG_CRITICAL, "--> got '" << rfc1738_escape(hello_buf) << "'"); goto cleanup; } /* assign file descriptors to child process */ if (_pipe(p2c, 1024, _O_BINARY | _O_NOINHERIT) < 0) { - debugs(54, 0, "ipcCreate: CHILD: pipe: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: pipe: " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } if (_pipe(c2p, 1024, _O_BINARY | _O_NOINHERIT) < 0) { - debugs(54, 0, "ipcCreate: CHILD: pipe: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: pipe: " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -465,7 +465,7 @@ ipc_thread_1(void *in_params) crfd_ipc = cwfd_ipc = comm_open(SOCK_DGRAM, IPPROTO_UDP, local_addr, 0, buf1); if (crfd_ipc < 0) { - debugs(54, 0, "ipcCreate: CHILD: Failed to create child FD for " << prog << "."); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: Failed to create child FD for " << prog << "."); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -474,7 +474,7 @@ ipc_thread_1(void *in_params) prfd_ipc = pwfd_ipc = comm_open(SOCK_DGRAM, IPPROTO_UDP, local_addr, 0, buf1); if (pwfd_ipc < 0) { - debugs(54, 0, "ipcCreate: CHILD: Failed to create server FD for " << prog << "."); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: Failed to create server FD for " << prog << "."); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -482,7 +482,7 @@ ipc_thread_1(void *in_params) PS_ipc.InitAddrInfo(aiPS_ipc); if (getsockname(pwfd_ipc, aiPS_ipc->ai_addr, &(aiPS_ipc->ai_addrlen)) < 0) { - debugs(54, 0, "ipcCreate: getsockname: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -494,7 +494,7 @@ ipc_thread_1(void *in_params) CS_ipc.InitAddrInfo(aiCS_ipc); if (getsockname(crfd_ipc, aiCS_ipc->ai_addr, &(aiCS_ipc->ai_addrlen)) < 0) { - debugs(54, 0, "ipcCreate: getsockname: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -589,7 +589,7 @@ ipc_thread_1(void *in_params) if (pid == -1) { errno = x; - debugs(54, 0, "ipcCreate: CHILD: " << params->prog << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << params->prog << ": " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; @@ -601,7 +601,7 @@ ipc_thread_1(void *in_params) memset(&wpi, 0, sizeof(wpi)); if (SOCKET_ERROR == WSADuplicateSocket(crfd_ipc, pid, &wpi)) { - debugs(54, 0, "ipcCreate: CHILD: WSADuplicateSocket: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: WSADuplicateSocket: " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; @@ -610,8 +610,8 @@ ipc_thread_1(void *in_params) x = write(c2p[1], (const char *) &wpi, sizeof(wpi)); if (x < (ssize_t)sizeof(wpi)) { - debugs(54, 0, "ipcCreate: CHILD: write FD " << c2p[1] << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: write FD " << c2p[1] << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; @@ -620,16 +620,16 @@ ipc_thread_1(void *in_params) x = read(p2c[0], buf1, 8192); if (x < 0) { - debugs(54, 0, "ipcCreate: CHILD: read FD " << p2c[0] << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: read FD " << p2c[0] << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } else if (strncmp(buf1, ok_string, strlen(ok_string))) { - debugs(54, 0, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); - debugs(54, 0, "--> read returned " << x); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); + debugs(54, DBG_CRITICAL, "--> read returned " << x); buf1[x] = '\0'; - debugs(54, 0, "--> got '" << rfc1738_escape(buf1) << "'"); + debugs(54, DBG_CRITICAL, "--> got '" << rfc1738_escape(buf1) << "'"); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -637,8 +637,8 @@ ipc_thread_1(void *in_params) x = write(c2p[1], (const char *) &PS_ipc, sizeof(PS_ipc)); if (x < (ssize_t)sizeof(PS_ipc)) { - debugs(54, 0, "ipcCreate: CHILD: write FD " << c2p[1] << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: write FD " << c2p[1] << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; @@ -647,16 +647,16 @@ ipc_thread_1(void *in_params) x = read(p2c[0], buf1, 8192); if (x < 0) { - debugs(54, 0, "ipcCreate: CHILD: read FD " << p2c[0] << ": " << xstrerror()); - debugs(54, 0, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: read FD " << p2c[0] << ": " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } else if (strncmp(buf1, ok_string, strlen(ok_string))) { - debugs(54, 0, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); - debugs(54, 0, "--> read returned " << x); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: " << prog << ": socket exchange failed"); + debugs(54, DBG_CRITICAL, "--> read returned " << x); buf1[x] = '\0'; - debugs(54, 0, "--> got '" << rfc1738_escape(buf1) << "'"); + debugs(54, DBG_CRITICAL, "--> got '" << rfc1738_escape(buf1) << "'"); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -695,7 +695,7 @@ ipc_thread_1(void *in_params) thread = (HANDLE)_beginthreadex(NULL, 0, ipc_thread_2, &thread_params, 0, NULL); if (!thread) { - debugs(54, 0, "ipcCreate: CHILD: _beginthreadex: " << xstrerror()); + debugs(54, DBG_CRITICAL, "ipcCreate: CHILD: _beginthreadex: " << xstrerror()); ipcSend(cwfd, err_string, strlen(err_string)); goto cleanup; } @@ -761,14 +761,14 @@ cleanup: WaitForSingleObject(hProcess, type == IPC_UDP_SOCKET ? 12000 : 5000)) { getCurrentTime(); - debugs(54, 0, "ipc(" << prog << "," << pid << "): WARNING: " << prog << + debugs(54, DBG_CRITICAL, "ipc(" << prog << "," << pid << "): WARNING: " << prog << " didn't exit in " << (type == IPC_UDP_SOCKET ? 12 : 5) << " seconds."); } if (thread && WAIT_OBJECT_0 != WaitForSingleObject(thread, 3000)) { getCurrentTime(); - debugs(54, 0, "ipc(" << prog << "," << pid << "): WARNING: ipc_thread_2 didn't exit in 3 seconds."); + debugs(54, DBG_CRITICAL, "ipc(" << prog << "," << pid << "): WARNING: ipc_thread_2 didn't exit in 3 seconds."); } diff --git a/src/ipcache.cc b/src/ipcache.cc index 49f7466f5a..0fd64c81cc 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -186,12 +186,12 @@ static void ipcacheRelease(ipcache_entry * i, bool dofree) { if (!i) { - debugs(14, 0, "ipcacheRelease: Releasing entry with i="); + debugs(14, DBG_CRITICAL, "ipcacheRelease: Releasing entry with i="); return; } if (!i || !i->hash.key) { - debugs(14, 0, "ipcacheRelease: Releasing entry without hash link!"); + debugs(14, DBG_CRITICAL, "ipcacheRelease: Releasing entry without hash link!"); return; } @@ -805,12 +805,12 @@ ipcacheStatPrint(ipcache_entry * i, StoreEntry * sentry) char buf[MAX_IPSTRLEN]; if (!sentry) { - debugs(14, 0, HERE << "CRITICAL: sentry is NULL!"); + debugs(14, DBG_CRITICAL, HERE << "CRITICAL: sentry is NULL!"); return; } if (!i) { - debugs(14, 0, HERE << "CRITICAL: ipcache_entry is NULL!"); + debugs(14, DBG_CRITICAL, HERE << "CRITICAL: ipcache_entry is NULL!"); storeAppendPrintf(sentry, "CRITICAL ERROR\n"); return; } diff --git a/src/main.cc b/src/main.cc index af63250606..7d307591e8 100644 --- a/src/main.cc +++ b/src/main.cc @@ -910,10 +910,10 @@ setEffectiveUser(void) #endif if (geteuid() == 0) { - debugs(0, 0, "Squid is not safe to run as root! If you must"); - debugs(0, 0, "start Squid as root, then you must configure"); - debugs(0, 0, "it to run as a non-priveledged user with the"); - debugs(0, 0, "'cache_effective_user' option in the config file."); + debugs(0, DBG_CRITICAL, "Squid is not safe to run as root! If you must"); + debugs(0, DBG_CRITICAL, "start Squid as root, then you must configure"); + debugs(0, DBG_CRITICAL, "it to run as a non-priveledged user with the"); + debugs(0, DBG_CRITICAL, "'cache_effective_user' option in the config file."); fatal("Don't run Squid as root, set 'cache_effective_user'!"); } } @@ -930,7 +930,7 @@ mainSetCwd(void) debugs(0, DBG_IMPORTANT, "Set Current Directory to " << Config.coredump_dir); return; } else { - debugs(50, 0, "chdir: " << Config.coredump_dir << ": " << xstrerror()); + debugs(50, DBG_CRITICAL, "chdir: " << Config.coredump_dir << ": " << xstrerror()); } } @@ -938,7 +938,7 @@ mainSetCwd(void) if (getcwd(pathbuf, MAXPATHLEN)) { debugs(0, DBG_IMPORTANT, "Current Directory is " << pathbuf); } else { - debugs(50, 0, "WARNING: Can't find current directory, getcwd: " << xstrerror()); + debugs(50, DBG_CRITICAL, "WARNING: Can't find current directory, getcwd: " << xstrerror()); } } @@ -974,14 +974,14 @@ mainInitialize(void) #endif - debugs(1, 0, "Starting Squid Cache version " << version_string << " for " << CONFIG_HOST_TYPE << "..."); + debugs(1, DBG_CRITICAL, "Starting Squid Cache version " << version_string << " for " << CONFIG_HOST_TYPE << "..."); #if _SQUID_WINDOWS_ if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { - debugs(1, 0, "Running as " << WIN32_Service_name << " Windows System Service on " << WIN32_OS_string); - debugs(1, 0, "Service command line is: " << WIN32_Service_Command_Line); + debugs(1, DBG_CRITICAL, "Running as " << WIN32_Service_name << " Windows System Service on " << WIN32_OS_string); + debugs(1, DBG_CRITICAL, "Service command line is: " << WIN32_Service_Command_Line); } else - debugs(1, 0, "Running on " << WIN32_OS_string); + debugs(1, DBG_CRITICAL, "Running on " << WIN32_OS_string); #endif debugs(1, DBG_IMPORTANT, "Process ID " << getpid()); @@ -1428,7 +1428,7 @@ SquidMain(int argc, char **argv) } setEffectiveUser(); - debugs(0, 0, "Creating Swap Directories"); + debugs(0, DBG_CRITICAL, "Creating Swap Directories"); Store::Root().create(); return 0; @@ -1628,7 +1628,7 @@ checkRunningPid(void) if (kill(pid, 0) < 0) return 0; - debugs(0, 0, "Squid is already running! Process ID " << pid); + debugs(0, DBG_CRITICAL, "Squid is already running! Process ID " << pid); return 1; } @@ -1919,7 +1919,7 @@ SquidShutdown() xmalloc_find_leaks(); - debugs(1, 0, "Memory used after shutdown: " << xmalloc_total); + debugs(1, DBG_CRITICAL, "Memory used after shutdown: " << xmalloc_total); #endif #if MEM_GEN_TRACE diff --git a/src/mime.cc b/src/mime.cc index f68555e154..1dfe35c1fd 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -433,12 +433,12 @@ MimeIcon::created (StoreEntry *newEntry) fd = file_open(path, O_RDONLY | O_BINARY); if (fd < 0) { - debugs(25, 0, "mimeLoadIconFile: " << path << ": " << xstrerror()); + debugs(25, DBG_CRITICAL, "mimeLoadIconFile: " << path << ": " << xstrerror()); return; } if (fstat(fd, &sb) < 0) { - debugs(25, 0, "mimeLoadIconFile: FD " << fd << ": fstat: " << xstrerror()); + debugs(25, DBG_CRITICAL, "mimeLoadIconFile: FD " << fd << ": fstat: " << xstrerror()); file_close(fd); return; } diff --git a/src/multicast.cc b/src/multicast.cc index 29b2824600..d3ac44d65b 100644 --- a/src/multicast.cc +++ b/src/multicast.cc @@ -61,7 +61,7 @@ mcastJoinGroups(const ipcache_addrs *ia, const DnsLookupDetails &, void *datanot int i; if (ia == NULL) { - debugs(7, 0, "comm_join_mcast_groups: Unknown host"); + debugs(7, DBG_CRITICAL, "comm_join_mcast_groups: Unknown host"); return; } diff --git a/src/neighbors.cc b/src/neighbors.cc index 08bd414794..8c5b9589ca 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1073,8 +1073,8 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const Ip::Address neighborIgnoreNonPeer(from, opcode); } else if (p->stats.pings_acked > 100) { if (100 * p->icp.counts[ICP_DENIED] / p->stats.pings_acked > 95) { - debugs(15, 0, "95%% of replies from '" << p->host << "' are UDP_DENIED"); - debugs(15, 0, "Disabling '" << p->host << "', please check your configuration."); + debugs(15, DBG_CRITICAL, "95%% of replies from '" << p->host << "' are UDP_DENIED"); + debugs(15, DBG_CRITICAL, "Disabling '" << p->host << "', please check your configuration."); neighborRemove(p); p = NULL; } else { @@ -1084,7 +1084,7 @@ neighborsUdpAck(const cache_key * key, icp_common_t * header, const Ip::Address } else if (opcode == ICP_MISS_NOFETCH) { mem->ping_reply_callback(p, ntype, AnyP::PROTO_ICP, header, mem->ircb_data); } else { - debugs(15, 0, "neighborsUdpAck: Unexpected ICP reply: " << opcode_d); + debugs(15, DBG_CRITICAL, "neighborsUdpAck: Unexpected ICP reply: " << opcode_d); } } @@ -1203,12 +1203,12 @@ peerDNSConfigure(const ipcache_addrs *ia, const DnsLookupDetails &, void *data) p->n_addresses = 0; if (ia == NULL) { - debugs(0, 0, "WARNING: DNS lookup for '" << p->host << "' failed!"); + debugs(0, DBG_CRITICAL, "WARNING: DNS lookup for '" << p->host << "' failed!"); return; } if ((int) ia->count < 1) { - debugs(0, 0, "WARNING: No IP address found for '" << p->host << "'!"); + debugs(0, DBG_CRITICAL, "WARNING: No IP address found for '" << p->host << "'!"); return; } diff --git a/src/pconn.cc b/src/pconn.cc index 3cc57a0b21..9593201a43 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -481,7 +481,7 @@ PconnModule::PconnModule() : pools(NULL), poolCount(0) { pools = (PconnPool **) xcalloc(MAX_NUM_PCONN_POOLS, sizeof(*pools)); //TODO: re-link to MemPools. WAS: pconn_fds_pool = memPoolCreate("pconn_fds", PCONN_FDS_SZ * sizeof(int)); - debugs(48, 0, "persistent connection module initialized"); + debugs(48, DBG_CRITICAL, "persistent connection module initialized"); registerWithCacheManager(); } diff --git a/src/peer_digest.cc b/src/peer_digest.cc index ad1557a780..daf62db9a9 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1025,13 +1025,13 @@ peerDigestSetCBlock(PeerDigest * pd, const char *buf) if (cblock.ver.required > cblock.ver.current || cblock.mask_size <= 0 || cblock.capacity <= 0 || cblock.bits_per_entry <= 0 || cblock.hash_func_count <= 0) { - debugs(72, 0, "" << host << " digest cblock is corrupted."); + debugs(72, DBG_CRITICAL, "" << host << " digest cblock is corrupted."); return 0; } /* check consistency further */ if ((size_t)cblock.mask_size != cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry)) { - debugs(72, 0, host << " digest cblock is corrupted " << + debugs(72, DBG_CRITICAL, host << " digest cblock is corrupted " << "(mask size mismatch: " << cblock.mask_size << " ? " << cacheDigestCalcMaskSize(cblock.capacity, cblock.bits_per_entry) << ")."); @@ -1040,7 +1040,7 @@ peerDigestSetCBlock(PeerDigest * pd, const char *buf) /* there are some things we cannot do yet */ if (cblock.hash_func_count != CacheDigestHashFuncCount) { - debugs(72, 0, "" << host << " digest: unsupported #hash functions: " << + debugs(72, DBG_CRITICAL, "" << host << " digest: unsupported #hash functions: " << cblock.hash_func_count << " ? " << CacheDigestHashFuncCount << "."); return 0; } @@ -1080,7 +1080,7 @@ peerDigestUseful(const PeerDigest * pd) const int bit_util = cacheDigestBitUtil(pd->cd); if (bit_util > 65) { - debugs(72, 0, "Warning: " << pd->host << + debugs(72, DBG_CRITICAL, "Warning: " << pd->host << " peer digest has too many bits on (" << bit_util << "%%)."); return 0; diff --git a/src/peer_select.cc b/src/peer_select.cc index c517b1335d..763085c21b 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -561,7 +561,7 @@ peerGetSomeNeighbor(ps_state * ps) &ps->ping.timeout); if (ps->ping.n_sent == 0) - debugs(44, 0, "WARNING: neighborsUdpPing returned 0"); + debugs(44, DBG_CRITICAL, "WARNING: neighborsUdpPing returned 0"); debugs(44, 3, "peerSelect: " << ps->ping.n_replies_expected << " ICP replies expected, RTT " << ps->ping.timeout << " msec"); diff --git a/src/repl/heap/store_repl_heap.cc b/src/repl/heap/store_repl_heap.cc index 6a564b0d21..2ff00bcbd1 100644 --- a/src/repl/heap/store_repl_heap.cc +++ b/src/repl/heap/store_repl_heap.cc @@ -331,7 +331,7 @@ createRemovalPolicy_heap(wordlist * args) else if (!strcmp(keytype, "LRU")) heap_data->keyfunc = HeapKeyGen_StoreEntry_LRU; else { - debugs(81, 0, "createRemovalPolicy_heap: Unknown key type \"" << keytype << "\". Using LRU"); + debugs(81, DBG_CRITICAL, "createRemovalPolicy_heap: Unknown key type \"" << keytype << "\". Using LRU"); heap_data->keyfunc = HeapKeyGen_StoreEntry_LRU; } diff --git a/src/stat.cc b/src/stat.cc index 518bbfc2c7..3699308c4c 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1436,7 +1436,7 @@ statAvgTick(void *notused) int i = (int) statPctileSvc(0.5, 20, PCTILE_HTTP); if (Config.warnings.high_rptm < i) - debugs(18, 0, "WARNING: Median response time is " << i << " milliseconds"); + debugs(18, DBG_CRITICAL, "WARNING: Median response time is " << i << " milliseconds"); } if (Config.warnings.high_pf) { @@ -1447,7 +1447,7 @@ statAvgTick(void *notused) i /= (int) dt; if (Config.warnings.high_pf < i) - debugs(18, 0, "WARNING: Page faults occuring at " << i << "/sec"); + debugs(18, DBG_CRITICAL, "WARNING: Page faults occuring at " << i << "/sec"); } } @@ -1467,7 +1467,7 @@ statAvgTick(void *notused) #endif if (Config.warnings.high_memory < i) - debugs(18, 0, "WARNING: Memory usage at " << ((unsigned long int)(i >> 20)) << " MB"); + debugs(18, DBG_CRITICAL, "WARNING: Memory usage at " << ((unsigned long int)(i >> 20)) << " MB"); } } diff --git a/src/stmem.cc b/src/stmem.cc index 09928c3423..49c0db62c2 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -92,7 +92,7 @@ bool mem_hdr::unlink(mem_node *aNode) { if (aNode->write_pending) { - debugs(0, 0, "cannot unlink mem_node " << aNode << " while write_pending"); + debugs(0, DBG_CRITICAL, "cannot unlink mem_node " << aNode << " while write_pending"); return false; } @@ -369,7 +369,7 @@ mem_hdr::write (StoreIOBuffer const &writeBuffer) debugs(19, 6, "mem_hdr::write: " << this << " " << writeBuffer.range() << " object end " << endOffset()); if (unionNotEmpty(writeBuffer)) { - debugs(19,0,"mem_hdr::write: writeBuffer: " << writeBuffer.range()); + debugs(19, DBG_CRITICAL, "mem_hdr::write: writeBuffer: " << writeBuffer.range()); debugDump(); fatal("Attempt to overwrite already in-memory data. Preceeding this there should be a mem_hdr::write output that lists the attempted write, and the currently present data. Please get a 'backtrace full' from this error - using the generated core, and file a bug report with the squid developers including the last 10 lines of cache.log and the backtrace.\n"); PROF_stop(mem_hdr_write); diff --git a/src/store.cc b/src/store.cc index bbe09799bd..2654beac98 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1830,7 +1830,7 @@ StoreEntry::replaceHttpReply(HttpReply *rep, bool andStartWriting) debugs(20, 3, "StoreEntry::replaceHttpReply: " << url()); if (!mem_obj) { - debugs(20, 0, "Attempt to replace object with no in-memory representation"); + debugs(20, DBG_CRITICAL, "Attempt to replace object with no in-memory representation"); return; } diff --git a/src/store_client.cc b/src/store_client.cc index 639623a467..b2d0c7b627 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -498,7 +498,7 @@ store_client::readBody(const char *buf, ssize_t len) HttpReply *rep = (HttpReply *) entry->getReply(); // bypass const if (!rep->parseCharBuf(copyInto.data, headersEnd(copyInto.data, len))) { - debugs(90, 0, "Could not parse headers from on disk object"); + debugs(90, DBG_CRITICAL, "Could not parse headers from on disk object"); } else { parsed_header = 1; } diff --git a/src/store_swapout.cc b/src/store_swapout.cc index a8d7bcdbb0..718c35ffe0 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -220,7 +220,7 @@ StoreEntry::swapOut() #if SIZEOF_OFF_T <= 4 if (mem_obj->endOffset() > 0x7FFF0000) { - debugs(20, 0, "WARNING: preventing off_t overflow for " << url()); + debugs(20, DBG_CRITICAL, "WARNING: preventing off_t overflow for " << url()); abort(); return; } diff --git a/src/tools.cc b/src/tools.cc index 3dfb24a9cc..eaf5fc16c8 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -428,7 +428,7 @@ sigusr2_handle(int sig) #if !HAVE_SIGACTION if (signal(sig, sigusr2_handle) == SIG_ERR) /* reinstall */ - debugs(50, 0, "signal: sig=" << sig << " func=sigusr2_handle: " << xstrerror()); + debugs(50, DBG_CRITICAL, "signal: sig=" << sig << " func=sigusr2_handle: " << xstrerror()); #endif } @@ -698,7 +698,7 @@ leave_suid(void) #endif if (setgid(Config2.effectiveGroupID) < 0) - debugs(50, 0, "ALERT: setgid: " << xstrerror()); + debugs(50, DBG_CRITICAL, "ALERT: setgid: " << xstrerror()); } @@ -714,10 +714,10 @@ leave_suid(void) if (!Config.effectiveGroup) { if (setgid(Config2.effectiveGroupID) < 0) - debugs(50, 0, "ALERT: setgid: " << xstrerror()); + debugs(50, DBG_CRITICAL, "ALERT: setgid: " << xstrerror()); if (initgroups(Config.effectiveUser, Config2.effectiveGroupID) < 0) { - debugs(50, 0, "ALERT: initgroups: unable to set groups for User " << + debugs(50, DBG_CRITICAL, "ALERT: initgroups: unable to set groups for User " << Config.effectiveUser << " and Group " << (unsigned) Config2.effectiveGroupID << ""); } @@ -726,17 +726,17 @@ leave_suid(void) #if HAVE_SETRESUID if (setresuid(Config2.effectiveUserID, Config2.effectiveUserID, 0) < 0) - debugs(50, 0, "ALERT: setresuid: " << xstrerror()); + debugs(50, DBG_CRITICAL, "ALERT: setresuid: " << xstrerror()); #elif HAVE_SETEUID if (seteuid(Config2.effectiveUserID) < 0) - debugs(50, 0, "ALERT: seteuid: " << xstrerror()); + debugs(50, DBG_CRITICAL, "ALERT: seteuid: " << xstrerror()); #else if (setuid(Config2.effectiveUserID) < 0) - debugs(50, 0, "ALERT: setuid: " << xstrerror()); + debugs(50, DBG_CRITICAL, "ALERT: setuid: " << xstrerror()); #endif @@ -911,7 +911,7 @@ writePidFile(void) leave_suid(); if (fd < 0) { - debugs(50, 0, "" << f << ": " << xstrerror()); + debugs(50, DBG_CRITICAL, "" << f << ": " << xstrerror()); debug_trap("Could not write pid file"); return; } diff --git a/src/url.cc b/src/url.cc index 10406196b2..eb1f239a26 100644 --- a/src/url.cc +++ b/src/url.cc @@ -409,7 +409,7 @@ urlParse(const HttpRequestMethod& method, char *url, HttpRequest *request) /* These ports are filtered in the default squid.conf, but * maybe someone wants them hardcoded... */ if (port == 7 || port == 9 || port == 19) { - debugs(23, 0, "urlParse: Deny access to port " << port); + debugs(23, DBG_CRITICAL, "urlParse: Deny access to port " << port); return NULL; } #endif diff --git a/src/wccp2.cc b/src/wccp2.cc index c002744546..b957668bc9 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -2124,7 +2124,7 @@ parse_wccp2_service(void *v) /* Snarf the type */ if ((t = strtok(NULL, w_space)) == NULL) { - debugs(80, 0, "wccp2ParseServiceInfo: missing service info type (standard|dynamic)"); + debugs(80, DBG_CRITICAL, "wccp2ParseServiceInfo: missing service info type (standard|dynamic)"); self_destruct(); } @@ -2133,7 +2133,7 @@ parse_wccp2_service(void *v) } else if (strcmp(t, "dynamic") == 0) { service = WCCP2_SERVICE_DYNAMIC; } else { - debugs(80, 0, "wccp2ParseServiceInfo: bad service info type (expected standard|dynamic, got " << t << ")"); + debugs(80, DBG_CRITICAL, "wccp2ParseServiceInfo: bad service info type (expected standard|dynamic, got " << t << ")"); self_destruct(); }