Renamed DebugGoOn to DebugCrit so it better matches its purpose.

Swapped order of DebugCall and DebugNote so DebugCall is less visible.
Changed default debug level to DebugNote.
Modified a few inadequate uses of DebugCrit.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6250 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2017-08-01 13:08:23 +00:00
parent 7d4da59ace
commit c4c9e994f0
53 changed files with 181 additions and 180 deletions

View File

@ -511,7 +511,7 @@ static void qtMsgHandler(QtMsgType type, const char* text)
dbg = DebugWarn;
break;
case QtCriticalMsg:
dbg = DebugGoOn;
dbg = DebugCrit;
break;
case QtFatalMsg:
dbg = DebugFail;
@ -3502,7 +3502,7 @@ bool QtClient::createWindow(const String& name, const String& alias)
return true;
}
else
Debug(QtDriver::self(),DebugGoOn,"Could not create window name=%s alias=%s",
Debug(QtDriver::self(),DebugCrit,"Could not create window name=%s alias=%s",
name.c_str(),alias.c_str());
return false;
}

View File

@ -269,7 +269,7 @@ void CallEndpoint::setLastPeerId()
return;
Lock lock(s_mutex,5000000);
if (!checkRetry(lock)) {
Alarm("engine","bug",DebugGoOn,"Set last peer ID failed - timeout on call endpoint mutex owned by '%s'!",s_mutex.owner());
Alarm("engine","bug",DebugCrit,"Set last peer ID failed - timeout on call endpoint mutex owned by '%s'!",s_mutex.owner());
return;
}
if (m_peer) {
@ -475,7 +475,7 @@ void Channel::initChan()
Lock mylock(m_driver);
#ifndef NDEBUG
if (m_driver->channels().find(this)) {
Debug(DebugGoOn,"Channel '%s' already in list of '%s' driver [%p]",
Debug(DebugCrit,"Channel '%s' already in list of '%s' driver [%p]",
id().c_str(),m_driver->name().c_str(),this);
return;
}

View File

@ -136,7 +136,7 @@ public:
virtual bool received(Message& msg) {
Client::s_engineStarted = true;
if (!(Client::self() && Client::self()->postpone(msg,Client::EngineStart)))
Debug(DebugGoOn,"Failed to postpone %s in client",msg.c_str());
Debug(DebugCrit,"Failed to postpone %s in client",msg.c_str());
return false;
}
};
@ -2859,7 +2859,7 @@ bool Client::addLogic(ClientLogic* logic)
if (logic->priority() < 0)
logic->m_prio = -logic->priority();
bool dup = (0 != s_logics.find(logic->toString()));
Debug(dup ? DebugGoOn : DebugInfo,"Adding client logic%s %p name=%s prio=%d",
Debug(dup ? DebugCrit : DebugInfo,"Adding client logic%s %p name=%s prio=%d",
dup ? " [DUPLICATE]" : "",logic,logic->toString().c_str(),logic->priority());
for (ObjList* l = s_logics.skipNull(); l; l = l->skipNext()) {

View File

@ -609,7 +609,7 @@ bool DataSource::attach(DataConsumer* consumer, bool override)
src2->detach(consumer);
s_consSrcMutex.lock();
if (src) {
Debug(DebugGoOn,"DataSource %p raced us attaching consumer %p [%p]",
Debug(DebugCrit,"DataSource %p raced us attaching consumer %p [%p]",
src,consumer,this);
s_consSrcMutex.unlock();
consumer->deref();

View File

@ -1279,7 +1279,7 @@ SLib::~SLib()
if (fini || m_nounload) {
count -= plugins.count();
if (count != m_count)
Debug(DebugGoOn,"Finalizing '%s' removed %u out of %u plugins",
Debug(DebugCrit,"Finalizing '%s' removed %u out of %u plugins",
c_str(),count,m_count);
checkPoint();
return;
@ -1288,19 +1288,19 @@ SLib::~SLib()
}
int err = dlclose(m_handle);
if (err)
Debug(DebugGoOn,"Error %d on dlclose(%p) of '%s'",err,m_handle,c_str());
Debug(DebugCrit,"Error %d on dlclose(%p) of '%s'",err,m_handle,c_str());
else if (s_keepclosing) {
int tries;
for (tries=0; tries<10; tries++)
if (dlclose(m_handle))
break;
if (tries)
Debug(DebugGoOn,"Made %d attempts to dlclose(%p) '%s'",
Debug(DebugCrit,"Made %d attempts to dlclose(%p) '%s'",
tries,m_handle,c_str());
}
count -= plugins.count();
if (count != m_count)
Debug(DebugGoOn,"Unloading '%s' removed %u out of %u plugins",
Debug(DebugWarn,"Unloading '%s' removed %u out of %u plugins",
c_str(),count,m_count);
checkPoint();
}
@ -1427,7 +1427,7 @@ int Engine::engineInit()
WSADATA wsaData;
int errc = ::WSAStartup(MAKEWORD(2,2), &wsaData);
if (errc) {
Debug(DebugGoOn,"Failed to initialize the Windows Sockets library, error code %d",errc);
Debug(DebugCrit,"Failed to initialize the Windows Sockets library, error code %d",errc);
return errc & 127;
}
#else
@ -1776,7 +1776,7 @@ int Engine::engineCleanup()
unsigned int cnt = plugins.count();
plugins.clear();
if (mux || cnt)
Debug(DebugGoOn,"Exiting with %d locked mutexes and %u plugins loaded!",mux,cnt);
Debug(DebugWarn,"Exiting with %d locked mutexes and %u plugins loaded!",mux,cnt);
if (GenObject::getObjCounting()) {
String str;
int obj = EngineStatusHandler::objects(str);
@ -2353,7 +2353,7 @@ int Engine::cleanupLibrary()
if (mux < 0)
mux = 0;
if (mux)
Debug(DebugGoOn,"Exiting with %d locked mutexes!",mux);
Debug(DebugCrit,"Exiting with %d locked mutexes!",mux);
if (GenObject::getObjCounting()) {
String str;
int obj = EngineStatusHandler::objects(str);

View File

@ -235,7 +235,7 @@ MutexPrivate::~MutexPrivate()
Debug(DebugFail,"MutexPrivate '%s' owned by '%s' destroyed with %u locks, %u waiting [%p]",
m_name,m_owner,m_locked,m_waiting,this);
else if (warn)
Debug(DebugGoOn,"MutexPrivate '%s' owned by '%s' unlocked in destructor [%p]",
Debug(DebugCrit,"MutexPrivate '%s' owned by '%s' unlocked in destructor [%p]",
m_name,m_owner,this);
}

View File

@ -2028,7 +2028,7 @@ bool Socket::select(bool* readok, bool* writeok, bool* except, struct timeval* t
if (tmp >= (SOCKET)FD_SETSIZE) {
if (localFail) {
localFail = false;
Alarm("engine","socket",DebugGoOn,"Socket::select: handle %d larger than compiled in maximum %d",
Alarm("engine","socket",DebugCrit,"Socket::select: handle %d larger than compiled in maximum %d",
tmp,FD_SETSIZE);
}
return false;

View File

@ -1051,21 +1051,21 @@ static char* string_printf(unsigned int& length, const char* format, va_list& va
if (len < 0) {
#ifdef _WINDOWS
if (errno == ERANGE) {
XDebug("String",DebugGoOn,"string_printf() incomplete write");
XDebug("String",DebugCrit,"string_printf() incomplete write");
buf[length] = 0;
length = 0;
return buf;
}
#endif
::free(buf);
Debug("String",DebugGoOn,"string_printf(): vsnprintf() failed!");
Debug("String",DebugCrit,"string_printf(): vsnprintf() failed!");
return 0;
}
if (len < (int)length)
length = len;
#ifdef XDEBUG
else if (len > (int)length || buf[len])
Debug("String",DebugGoOn,"string_printf() incomplete write");
Debug("String",DebugCrit,"string_printf() incomplete write");
#endif
buf[length] = 0;
return buf;

View File

@ -101,6 +101,7 @@ namespace TelEngine {
#define DebugMin DebugFail
#define DebugVis DebugConf
#define DebugDef DebugNote
#define DebugMax DebugAll
#define OUT_BUFFER_SIZE 8192
@ -111,7 +112,7 @@ namespace TelEngine {
#define REFOBJECT_MUTEX_COUNT 47
#endif
static int s_debug = DebugWarn;
static int s_debug = DebugDef;
static int s_indent = 0;
static bool s_debugging = true;
static bool s_abort = false;
@ -122,13 +123,13 @@ static Debugger::Formatting s_fmtstamp = Debugger::None;
static const char* const s_colors[11] = {
"\033[5;41;1;33m\033[K",// DebugFail - blinking yellow on red
"\033[44;1;37m\033[K", // DebugTest - white on blue
"\033[41;1;37m\033[K", // DebugGoOn - white on red
"\033[41;1;37m\033[K", // DebugCrit - white on red
"\033[41;37m\033[K", // DebugConf - gray on red
"\033[40;31m\033[K", // DebugStub - red on black
"\033[40;1;31m\033[K", // DebugWarn - light red on black
"\033[40;1;33m\033[K", // DebugMild - yellow on black
"\033[40;1;37m\033[K", // DebugCall - white on black
"\033[40;1;32m\033[K", // DebugNote - light green on black
"\033[40;1;37m\033[K", // DebugCall - white on black
"\033[40;1;36m\033[K", // DebugInfo - light cyan on black
"\033[40;36m\033[K" // DebugAll - cyan on black
};
@ -136,13 +137,13 @@ static const char* const s_colors[11] = {
static const char* const s_levels[11] = {
"FAIL",
"TEST",
"GOON",
"CRIT",
"CONF",
"STUB",
"WARN",
"MILD",
"CALL",
"NOTE",
"CALL",
"INFO",
"ALL",
};

View File

@ -227,7 +227,7 @@ ThreadPrivate* ThreadPrivate::create(Thread* t,const char* name,Thread::Priority
::pthread_attr_destroy(&attr);
#endif
if (e) {
Alarm("engine","system",DebugGoOn,"Error %d while creating pthread in '%s' [%p]",e,name,p);
Alarm("engine","system",DebugCrit,"Error %d while creating pthread in '%s' [%p]",e,name,p);
p->m_thread = 0;
p->destroy();
return 0;
@ -373,7 +373,7 @@ bool ThreadPrivate::cancel(bool hard)
}
m_running = false;
#ifdef _WINDOWS
Debug(DebugGoOn,"ThreadPrivate '%s' terminating win32 thread %lu [%p]",
Debug(DebugCrit,"ThreadPrivate '%s' terminating win32 thread %lu [%p]",
m_name,thread,this);
ret = ::TerminateThread(reinterpret_cast<HANDLE>(thread),0) != 0;
#else
@ -382,7 +382,7 @@ bool ThreadPrivate::cancel(bool hard)
m_name,&thread,this);
ret = !::pthread_cancel(thread);
#else
Debug(DebugGoOn,"ThreadPrivate '%s' cannot terminate %p on this platform [%p]",
Debug(DebugCrit,"ThreadPrivate '%s' cannot terminate %p on this platform [%p]",
m_name,&thread,this);
#endif
#endif /* _WINDOWS */
@ -487,14 +487,14 @@ void ThreadPrivate::killall()
else {
if (ok) {
#ifdef _WINDOWS
Debug(DebugGoOn,"Could not kill %p but seems OK to delete it (library bug?)",t);
Debug(DebugWarn,"Could not kill %p but seems OK to delete it (library bug?)",t);
s_tmutex.unlock();
t->destroy();
s_tmutex.lock();
if (t != l->get())
c = 1;
#else
Debug(DebugGoOn,"Could not kill cancelled %p so we'll abandon it (library bug?)",t);
Debug(DebugCrit,"Could not kill cancelled %p so we'll abandon it (library bug?)",t);
l->remove(t,false);
c = 1;
#endif
@ -502,7 +502,7 @@ void ThreadPrivate::killall()
}
Thread::msleep(1);
if (++c >= HARD_KILLS) {
Debug(DebugGoOn,"Could not kill %p, will use sledgehammer later.",t);
Debug(DebugWarn,"Could not kill %p, will use sledgehammer later.",t);
sledgehammer = true;
t->m_thread = 0;
l = l->next();
@ -515,10 +515,10 @@ void ThreadPrivate::killall()
// usually too big since many libraries have threads of their own...
if (sledgehammer) {
#ifdef THREAD_KILL
Debug(DebugGoOn,"Brutally killing remaining threads!");
Debug(DebugCrit,"Brutally killing remaining threads!");
::pthread_kill_other_threads_np();
#else
Debug(DebugGoOn,"Aargh! I cannot kill remaining threads on this platform!");
Debug(DebugCrit,"Cannot kill remaining threads on this platform!");
#endif
}
}

View File

@ -1138,7 +1138,7 @@ u_int8_t IAXFrame::packSubclass(u_int32_t value)
return i | 0x80;
v <<= 1;
}
Debug(DebugGoOn,"IAXFrame could not pack subclass %u (0x%x)",value,value);
Debug(DebugCrit,"IAXFrame could not pack subclass %u (0x%x)",value,value);
return 0;
}
@ -1525,7 +1525,7 @@ unsigned int IAXMetaTrunkFrame::add(u_int16_t sCallNo, const DataBlock& data, u_
return 0;
// Avoid buffer overflow
if (data.length() > m_maxDataLen) {
Debug(m_engine,DebugGoOn,
Debug(m_engine,DebugWarn,
"Trunk frame '%s:%d' can't add %u bytes (max=%u) for call %u [%p]",
m_addr.host().c_str(),m_addr.port(),data.length(),m_maxDataLen,sCallNo,this);
return 0;

View File

@ -2002,7 +2002,7 @@ JBStreamSet::JBStreamSet(JBStreamSetList* owner)
JBStreamSet::~JBStreamSet()
{
if (m_clients.skipNull())
Debug(m_owner->engine(),DebugGoOn,
Debug(m_owner->engine(),DebugCrit,
"JBStreamSet(%s) destroyed while owning %u streams [%p]",
m_owner->toString().c_str(),m_clients.count(),this);
m_owner->remove(this);

View File

@ -598,7 +598,7 @@ void MGCPEngine::cleanup(bool gracefully, const char* text)
while (m_threads.skipNull()) {
mylock.drop();
if (Time::now() > maxWait) {
Debug(this,DebugGoOn,"Private threads did not terminate!");
Debug(this,DebugCrit,"Private threads did not terminate!");
return;
}
Thread::idle();

View File

@ -132,7 +132,7 @@ bool MultiRouter::received(Message& msg, int id)
info = m_list.find(call);
if (info) {
if (*info != chanid) {
Debug(DebugGoOn,"Channel mismatch! call=%p id='%s' stored='%s'",
Debug(DebugCrit,"Channel mismatch! call=%p id='%s' stored='%s'",
call,chanid.c_str(),info->c_str());
return false;
}
@ -145,7 +145,7 @@ bool MultiRouter::received(Message& msg, int id)
else if (!info->call())
info->setCall(call);
else if (info->call() != call) {
Debug(DebugGoOn,"Channel mismatch! id='%s' call=%p stored=%p",
Debug(DebugCrit,"Channel mismatch! id='%s' call=%p stored=%p",
chanid.c_str(),call,info->call());
return false;
}

View File

@ -187,7 +187,7 @@ RTPTransport::~RTPTransport()
DDebug(DebugAll,"RTPTransport::~RTPTransport() [%p]",this);
RTPGroup* g = group();
if (g)
Debug(DebugGoOn,"RTPTransport destroyed while in RTPGroup %p [%p]",g,this);
Debug(DebugCrit,"RTPTransport destroyed while in RTPGroup %p [%p]",g,this);
group(0);
setProcessor();
setMonitor();

View File

@ -299,7 +299,7 @@ SignallingEngine::SignallingEngine(const char* name)
SignallingEngine::~SignallingEngine()
{
if (m_thread) {
Debug(this,DebugGoOn,
Debug(this,DebugCrit,
"Engine destroyed with worker thread still running [%p]",this);
stop();
}
@ -469,7 +469,7 @@ bool SignallingEngine::start(const char* name, Thread::Priority prio, unsigned l
return true;
}
delete tmp;
Debug(this,DebugGoOn,"Engine failed to start worker thread [%p]",this);
Debug(this,DebugCrit,"Engine failed to start worker thread [%p]",this);
return false;
}

View File

@ -45,7 +45,7 @@ const TokenDict SignallingInterface::s_notifName[] = {
SignallingInterface::~SignallingInterface()
{
if (m_receiver)
Debug(this,DebugGoOn,"Destroyed with receiver (%p) attached",m_receiver);
Debug(this,DebugCrit,"Destroyed with receiver (%p) attached",m_receiver);
}
void SignallingInterface::attach(SignallingReceiver* receiver)
@ -105,7 +105,7 @@ SignallingReceiver::SignallingReceiver(const char* name)
SignallingReceiver::~SignallingReceiver()
{
if (m_interface)
Debug(this,DebugGoOn,"Destroyed with interface (%p) attached",m_interface);
Debug(this,DebugCrit,"Destroyed with interface (%p) attached",m_interface);
TelEngine::destruct(attach(0));
}

View File

@ -4270,11 +4270,11 @@ SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio,
const IsupParam* param = getParamDesc(ptype);
if (!param) {
// this is fatal as we don't know the length
Debug(this,DebugGoOn,"Missing description of fixed ISUP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of fixed ISUP parameter 0x%02x [%p]",ptype,this);
return 0;
}
if (!param->size) {
Debug(this,DebugGoOn,"Invalid (variable) description of fixed ISUP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Invalid (variable) description of fixed ISUP parameter 0x%02x [%p]",ptype,this);
return 0;
}
len += param->size;
@ -4286,7 +4286,7 @@ SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio,
const IsupParam* param = getParamDesc(ptype);
if (!param) {
// this is fatal as we won't be able to populate later
Debug(this,DebugGoOn,"Missing description of variable ISUP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of variable ISUP parameter 0x%02x [%p]",ptype,this);
return 0;
}
if (param->size)
@ -4327,7 +4327,7 @@ SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio,
continue;
}
if (!encodeParam(this,*msu,param,params,exclude,prefix,d))
Debug(this,DebugGoOn,"Could not encode fixed ISUP parameter %s [%p]",param->name,this);
Debug(this,DebugCrit,"Could not encode fixed ISUP parameter %s [%p]",param->name,this);
d += param->size;
}
// now populate with mandatory variable parameters
@ -4346,11 +4346,11 @@ SS7MSU* SS7ISUP::buildMSU(SS7MsgISUP::Type type, unsigned char sio,
unsigned char size = encodeParam(this,*msu,param,params,exclude,prefix);
d = msu->getData(0,len+1);
if (!(size && d)) {
Debug(this,DebugGoOn,"Could not encode variable ISUP parameter %s [%p]",param->name,this);
Debug(this,DebugCrit,"Could not encode variable ISUP parameter %s [%p]",param->name,this);
continue;
}
if ((d[len] != size) || (msu->length() != (len+1+size))) {
Debug(this,DebugGoOn,"Invalid encoding variable ISUP parameter %s (len=%u size=%u stor=%u) [%p]",
Debug(this,DebugCrit,"Invalid encoding variable ISUP parameter %s (len=%u size=%u stor=%u) [%p]",
param->name,len,size,d[len],this);
continue;
}
@ -4513,11 +4513,11 @@ bool SS7ISUP::decodeMessage(NamedList& msg,
const IsupParam* param = getParamDesc(ptype);
if (!param) {
// this is fatal as we don't know the length
Debug(this,DebugGoOn,"Missing description of fixed ISUP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of fixed ISUP parameter 0x%02x [%p]",ptype,this);
return false;
}
if (!param->size) {
Debug(this,DebugGoOn,"Invalid (variable) description of fixed ISUP parameter %s [%p]",param->name,this);
Debug(this,DebugCrit,"Invalid (variable) description of fixed ISUP parameter %s [%p]",param->name,this);
return false;
}
if (paramLen < param->size) {
@ -4539,7 +4539,7 @@ bool SS7ISUP::decodeMessage(NamedList& msg,
const IsupParam* param = getParamDesc(ptype);
if (!param) {
// we could skip over unknown mandatory variable length but it's still bad
Debug(this,DebugGoOn,"Missing description of variable ISUP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of variable ISUP parameter 0x%02x [%p]",ptype,this);
return false;
}
if (param->size)

View File

@ -1751,7 +1751,7 @@ ISDNLayer2::ISDNLayer2(const NamedList& params, const char* name, u_int8_t tei)
ISDNLayer2::~ISDNLayer2()
{
if (m_layer3)
Debug(this,DebugGoOn,"Destroyed with Layer 3 (%p) attached",m_layer3);
Debug(this,DebugCrit,"Destroyed with Layer 3 (%p) attached",m_layer3);
attach(0);
XDebug(this,DebugAll,"~ISDNLayer2");
}

View File

@ -1249,7 +1249,7 @@ bool SS7Router::setRouteSpecificState(SS7PointCode::Type type, unsigned int pack
continue;
SS7Route* r = l3->findRoute(type,packedPC);
if (!r) {
Debug(this,DebugGoOn,"Route to %u not found in network '%s'",packedPC,l3->toString().c_str());
Debug(this,DebugWarn,"Route to %u not found in network '%s'",packedPC,l3->toString().c_str());
continue;
}
ok = true;

View File

@ -1447,9 +1447,9 @@ SCCP::~SCCP()
DDebug(this,DebugAll,"Destroying SCCP [%p]",this);
// If we have undetached users scream as hard as we can
if (m_users.skipNull())
Debug(this,DebugGoOn,"Destroying SCCP with %d undetached users!!!",m_users.count());
Debug(this,DebugCrit,"Destroying SCCP with %d undetached users!!!",m_users.count());
if (m_translator)
Debug(this,DebugGoOn,"Destroying SCCP with an valid translator!!!");
Debug(this,DebugCrit,"Destroying SCCP with a valid translator!!!");
}
void SCCP::attach(SCCPUser* user)
@ -2953,7 +2953,7 @@ int SS7SCCP::transmitMessage(SS7MsgSCCP* sccpMsg, bool local)
if (!sccpMsg || !sccpMsg->getData())
return -1;
if (unknownPointCodeType()) {
Debug(this,DebugGoOn,"SCCP unavailable!! Reason Unknown pointcode type %s",SS7PointCode::lookup(m_type));
Debug(this,DebugConf,"SCCP unavailable!! Reason Unknown pointcode type %s",SS7PointCode::lookup(m_type));
return -1;
}
Lock lock(this);
@ -3147,7 +3147,7 @@ void SS7SCCP::checkSCLCOptParams(SS7MsgSCCP* msg)
int SS7SCCP::sendMessage(DataBlock& data, const NamedList& params)
{
if (unknownPointCodeType()) {
Debug(this,DebugGoOn,"SCCP unavailable!! Reason Unknown pointcode type %s",SS7PointCode::lookup(m_type));
Debug(this,DebugConf,"SCCP unavailable!! Reason Unknown pointcode type %s",SS7PointCode::lookup(m_type));
return -1;
}
#ifdef XDEBUG
@ -3234,7 +3234,7 @@ void SS7SCCP::getMaxDataLen(const SS7MsgSCCP* msg, const SS7Label& label,
unsigned int& udt, unsigned int& xudt, unsigned int& ludt)
{
if (!network()) {
Debug(this,DebugGoOn,"No Network Attached!!!");
Debug(this,DebugConf,"No Network Attached!!!");
return;
}
@ -3411,7 +3411,7 @@ int SS7SCCP::segmentMessage(SS7MsgSCCP* origMsg, const SS7Label& label, bool loc
ajustMessageParams(origMsg->params(),origMsg->type());
SS7MSU* msu = buildMSU(origMsg,label,false);
if (!msu) {
Debug(this,DebugGoOn,"Failed to build msu from sccpMessage %s",
Debug(this,DebugWarn,"Failed to build MSU from sccpMessage %s",
SS7MsgSCCP::lookup(origMsg->type()));
return -1;
}
@ -3475,7 +3475,7 @@ int SS7SCCP::segmentMessage(SS7MsgSCCP* origMsg, const SS7Label& label, bool loc
msg->removeData();
temp.clear(false);
if (!msu) {
Debug(this,DebugGoOn,"Failed to build msu from sccpMessage %s",
Debug(this,DebugWarn,"Failed to build MSU from sccpMessage %s",
SS7MsgSCCP::lookup(msgType));
TelEngine::destruct(msg);
TelEngine::destruct(listSegments);
@ -3518,7 +3518,7 @@ int SS7SCCP::segmentMessage(SS7MsgSCCP* origMsg, const SS7Label& label, bool loc
msg->removeData();
temp.clear(false);
if (!msu) {
Debug(this,DebugGoOn,"Failed to build msu from sccpMessage %s",
Debug(this,DebugWarn,"Failed to build MSU from sccpMessage %s",
SS7MsgSCCP::lookup(msgType));
TelEngine::destruct(msg);
TelEngine::destruct(listSegments);
@ -3610,11 +3610,11 @@ SS7MSU* SS7SCCP::buildMSU(SS7MsgSCCP* msg, const SS7Label& label, bool checkLeng
const SCCPParam* param = getParamDesc(ptype);
if (!param) {
// this is fatal as we don't know the length
Debug(this,DebugGoOn,"Missing description of fixed SCCP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of fixed SCCP parameter 0x%02x [%p]",ptype,this);
return 0;
}
if (!param->size) {
Debug(this,DebugGoOn,"Invalid (variable) description of fixed SCCP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Invalid (variable) description of fixed SCCP parameter 0x%02x [%p]",ptype,this);
return 0;
}
len += param->size;
@ -3628,7 +3628,7 @@ SS7MSU* SS7SCCP::buildMSU(SS7MsgSCCP* msg, const SS7Label& label, bool checkLeng
const SCCPParam* param = getParamDesc(ptype);
if (!param) {
// this is fatal as we won't be able to populate later
Debug(this,DebugGoOn,"Missing description of variable SCCP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of variable SCCP parameter 0x%02x [%p]",ptype,this);
return 0;
}
if (param->size)
@ -3656,7 +3656,7 @@ SS7MSU* SS7SCCP::buildMSU(SS7MsgSCCP* msg, const SS7Label& label, bool checkLeng
continue;
}
if (!encodeParam(this,*msu,param,&msg->params(),exclude,prefix,d))
Debug(this,DebugGoOn,"Could not encode fixed SCCP parameter %s [%p]",param->name,this);
Debug(this,DebugCrit,"Could not encode fixed SCCP parameter %s [%p]",param->name,this);
d += param->size;
}
// now populate with mandatory variable parameters
@ -3688,11 +3688,11 @@ SS7MSU* SS7SCCP::buildMSU(SS7MsgSCCP* msg, const SS7Label& label, bool checkLeng
size = encodeParam(this,*msu,param,&msg->params(),exclude,prefix);
d = msu->getData(0,len+1);
if (!(size && d)) {
Debug(this,DebugGoOn,"Could not encode variable SCCP parameter %s [%p]",param->name,this);
Debug(this,DebugCrit,"Could not encode variable SCCP parameter %s [%p]",param->name,this);
continue;
}
if (ptype != SS7MsgSCCP::LongData && ((d[len] != size) || (msu->length() != (len + size + 1)))) {
Debug(this,DebugGoOn,"Invalid encoding variable SCCP parameter %s (len=%u size=%u stor=%u msuLength = %u) [%p]",
Debug(this,DebugCrit,"Invalid encoding variable SCCP parameter %s (len=%u size=%u stor=%u msuLength = %u) [%p]",
param->name,len,size,d[len],msu->length(),this);
continue;
}
@ -4217,11 +4217,11 @@ bool SS7SCCP::decodeMessage(SS7MsgSCCP* msg, SS7PointCode::Type pcType,
const SCCPParam* param = getParamDesc(ptype);
if (!param) {
// this is fatal as we don't know the length
Debug(this,DebugGoOn,"Missing description of fixed SCCP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of fixed SCCP parameter 0x%02x [%p]",ptype,this);
return false;
}
if (!param->size) {
Debug(this,DebugGoOn,"Invalid (variable) description of fixed SCCP parameter %s [%p]",param->name,this);
Debug(this,DebugCrit,"Invalid (variable) description of fixed SCCP parameter %s [%p]",param->name,this);
return false;
}
if (paramLen < param->size) {
@ -4245,13 +4245,13 @@ bool SS7SCCP::decodeMessage(SS7MsgSCCP* msg, SS7PointCode::Type pcType,
const SCCPParam* param = getParamDesc(ptype);
if (!param) {
// we could skip over unknown mandatory variable length but it's still bad
Debug(this,DebugGoOn,"Missing description of variable SCCP parameter 0x%02x [%p]",ptype,this);
Debug(this,DebugCrit,"Missing description of variable SCCP parameter 0x%02x [%p]",ptype,this);
return false;
}
if (param->size)
Debug(this,DebugMild,"Invalid (fixed) description of variable SCCP parameter %s [%p]",param->name,this);
if (!paramPtr || paramLen <= 0) {
Debug(this,DebugGoOn,
Debug(this,DebugWarn,
"Unexpected end of stream!! Expecting to decode variabile parameter %s but there is no data left!!!",
param->name);
return false;

View File

@ -277,7 +277,7 @@ SS7TCAP::~SS7TCAP()
{
Debug(this,DebugAll,"SS7TCAP::~SS7TCAP() [%p] destroyed, refCount=%d, usersCount=%d",this,refcount(),m_users.count());
if (m_users.count()) {
Debug(this,DebugGoOn,"SS7TCAP destroyed while having %d user(s) still attached [%p]",m_users.count(),this);
Debug(this,DebugCrit,"SS7TCAP destroyed while having %d user(s) still attached [%p]",m_users.count(),this);
ListIterator iter(m_users);
for (;;) {
TCAPUser* user = static_cast<TCAPUser*>(iter.get());

View File

@ -209,7 +209,7 @@ void SIPMessage::complete(SIPEngine* engine, const char* user, const char* domai
if (!getParty()) {
engine->buildParty(this);
if (!getParty()) {
Debug(engine,DebugGoOn,"Could not complete party-less SIP message [%p]",this);
Debug(engine,DebugCrit,"Could not complete party-less SIP message [%p]",this);
return;
}
}

View File

@ -183,7 +183,7 @@ bool SIPTransaction::changeState(int newstate)
if ((newstate < 0) || (newstate == m_state))
return false;
if (m_state == Invalid) {
Debug(getEngine(),DebugGoOn,"SIPTransaction is already invalid [%p]",this);
Debug(getEngine(),DebugWarn,"SIPTransaction is already invalid [%p]",this);
return false;
}
DDebug(getEngine(),DebugAll,"SIPTransaction state changed from %s to %s [%p]",

View File

@ -676,13 +676,13 @@ void CallGenPlugin::initialize()
CleanThread* cln = new CleanThread;
if (!cln->startup()) {
Debug(DebugGoOn,"Failed to start call generator cleaner thread");
Debug(DebugCrit,"Failed to start call generator cleaner thread");
delete cln;
return;
}
GenThread* gen = new GenThread;
if (!gen->startup()) {
Debug(DebugGoOn,"Failed to start call generator thread");
Debug(DebugCrit,"Failed to start call generator thread");
delete gen;
}
}

View File

@ -182,23 +182,23 @@ bool DSoundPlay::init()
{
HRESULT hr;
if (FAILED(hr = ::CoInitializeEx(NULL,COINIT_MULTITHREADED))) {
Debug(DebugGoOn,"Could not initialize the COM library, code 0x%X",hr);
Debug(DebugCrit,"Could not initialize the COM library, code 0x%X",hr);
return false;
}
if (FAILED(hr = ::CoCreateInstance(CLSID_DirectSound, NULL, CLSCTX_INPROC_SERVER,
IID_IDirectSound, (void**)&m_ds)) || !m_ds) {
Debug(DebugGoOn,"Could not create the DirectSound object, code 0x%X",hr);
Debug(DebugCrit,"Could not create the DirectSound object, code 0x%X",hr);
return false;
}
if (FAILED(hr = m_ds->Initialize(m_device))) {
Debug(DebugGoOn,"Could not initialize the DirectSound object, code 0x%X",hr);
Debug(DebugWarn,"Could not initialize the DirectSound object, code 0x%X",hr);
return false;
}
HWND wnd = GetForegroundWindow();
if (!wnd)
wnd = GetDesktopWindow();
if (FAILED(hr = m_ds->SetCooperativeLevel(wnd,s_primary ? DSSCL_WRITEPRIMARY : DSSCL_EXCLUSIVE))) {
Debug(DebugGoOn,"Could not set the DirectSound cooperative level, code 0x%X",hr);
Debug(DebugCrit,"Could not set the DirectSound cooperative level, code 0x%X",hr);
return false;
}
@ -234,23 +234,23 @@ bool DSoundPlay::init()
bdesc.lpwfxFormat = &fmt;
}
if (FAILED(hr = m_ds->CreateSoundBuffer(&bdesc, &m_dsb, NULL)) || !m_dsb) {
Debug(DebugGoOn,"Could not create the DirectSound buffer, code 0x%X",hr);
Debug(DebugCrit,"Could not create the DirectSound buffer, code 0x%X",hr);
return false;
}
// format can be changed only for primary buffers
if (s_primary && FAILED(hr = m_dsb->SetFormat(&fmt))) {
Debug(DebugGoOn,"Could not set the DirectSound buffer format, code 0x%X",hr);
Debug(DebugWarn,"Could not set the DirectSound buffer format, code 0x%X",hr);
return false;
}
if (FAILED(hr = m_dsb->GetFormat(&fmt,sizeof(fmt),0))) {
Debug(DebugGoOn,"Could not get the DirectSound buffer format, code 0x%X",hr);
Debug(DebugWarn,"Could not get the DirectSound buffer format, code 0x%X",hr);
return false;
}
if ((fmt.wFormatTag != WAVE_FORMAT_PCM) ||
(fmt.nChannels != nChannels) ||
(fmt.nSamplesPerSec != m_rate) ||
(fmt.wBitsPerSample != 16)) {
Debug(DebugGoOn,"DirectSound does not support %dHz 16bit %s PCM format, "
Debug(DebugWarn,"DirectSound does not support %dHz 16bit %s PCM format, "
"got fmt=%u, chans=%d samp=%d size=%u",m_rate,nChannels == 1 ? "mono" : "stereo",
fmt.wFormatTag,fmt.nChannels,fmt.nSamplesPerSec,fmt.wBitsPerSample);
return false;
@ -258,14 +258,14 @@ bool DSoundPlay::init()
DSBCAPS caps;
caps.dwSize = sizeof(caps);
if (FAILED(hr = m_dsb->GetCaps(&caps))) {
Debug(DebugGoOn,"Could not get the DirectSound buffer capabilities, code 0x%X",hr);
Debug(DebugCrit,"Could not get the DirectSound buffer capabilities, code 0x%X",hr);
return false;
}
m_buffSize = caps.dwBufferBytes;
Debug(&__plugin,DebugInfo,"DirectSound buffer size %u",m_buffSize);
if (FAILED(hr = m_dsb->Play(0,0,DSBPLAY_LOOPING))) {
if ((hr != DSERR_BUFFERLOST) || FAILED(hr = m_dsb->Restore())) {
Debug(DebugGoOn,"Could not play the DirectSound buffer, code 0x%X",hr);
Debug(DebugWarn,"Could not play the DirectSound buffer, code 0x%X",hr);
return false;
}
m_dsb->Play(0,0,DSBPLAY_LOOPING);
@ -449,16 +449,16 @@ bool DSoundRec::init()
{
HRESULT hr;
if (FAILED(hr = ::CoInitializeEx(NULL,COINIT_MULTITHREADED))) {
Debug(DebugGoOn,"Could not initialize the COM library, code 0x%X",hr);
Debug(DebugCrit,"Could not initialize the COM library, code 0x%X",hr);
return false;
}
if (FAILED(hr = ::CoCreateInstance(CLSID_DirectSoundCapture, NULL, CLSCTX_INPROC_SERVER,
IID_IDirectSoundCapture, (void**)&m_ds)) || !m_ds) {
Debug(DebugGoOn,"Could not create the DirectSoundCapture object, code 0x%X",hr);
Debug(DebugCrit,"Could not create the DirectSoundCapture object, code 0x%X",hr);
return false;
}
if (FAILED(hr = m_ds->Initialize(m_device))) {
Debug(DebugGoOn,"Could not initialize the DirectSoundCapture object, code 0x%X",hr);
Debug(DebugWarn,"Could not initialize the DirectSoundCapture object, code 0x%X",hr);
return false;
}
WAVEFORMATEX fmt;
@ -476,18 +476,18 @@ bool DSoundRec::init()
bdesc.dwBufferBytes = 4 * m_rate / 25;
bdesc.lpwfxFormat = &fmt;
if (FAILED(hr = m_ds->CreateCaptureBuffer(&bdesc, &m_dsb, NULL)) || !m_dsb) {
Debug(DebugGoOn,"Could not create the DirectSoundCapture buffer, code 0x%X",hr);
Debug(DebugCrit,"Could not create the DirectSoundCapture buffer, code 0x%X",hr);
return false;
}
if (FAILED(hr = m_dsb->GetFormat(&fmt,sizeof(fmt),0))) {
Debug(DebugGoOn,"Could not get the DirectSoundCapture buffer format, code 0x%X",hr);
Debug(DebugCrit,"Could not get the DirectSoundCapture buffer format, code 0x%X",hr);
return false;
}
if ((fmt.wFormatTag != WAVE_FORMAT_PCM) ||
(fmt.nChannels != 1) ||
(fmt.nSamplesPerSec != m_rate) ||
(fmt.wBitsPerSample != 16)) {
Debug(DebugGoOn,"DirectSoundCapture does not support %dHz 16bit mono PCM format, "
Debug(DebugWarn,"DirectSoundCapture does not support %dHz 16bit mono PCM format, "
"got fmt=%u, chans=%d samp=%d size=%u",m_rate,
fmt.wFormatTag,fmt.nChannels,fmt.nSamplesPerSec,fmt.wBitsPerSample);
return false;
@ -495,13 +495,13 @@ bool DSoundRec::init()
DSCBCAPS caps;
caps.dwSize = sizeof(caps);
if (FAILED(hr = m_dsb->GetCaps(&caps))) {
Debug(DebugGoOn,"Could not get the DirectSoundCapture buffer capabilities, code 0x%X",hr);
Debug(DebugCrit,"Could not get the DirectSoundCapture buffer capabilities, code 0x%X",hr);
return false;
}
m_buffSize = caps.dwBufferBytes;
Debug(&__plugin,DebugInfo,"DirectSoundCapture buffer size %u",m_buffSize);
if (FAILED(hr = m_dsb->Start(DSCBSTART_LOOPING))) {
Debug(DebugGoOn,"Could not record to the DirectSoundCapture buffer, code 0x%X",hr);
Debug(DebugWarn,"Could not record to the DirectSoundCapture buffer, code 0x%X",hr);
return false;
}
return true;

View File

@ -325,7 +325,7 @@ void EnumModule::initialize()
if (Resolver::available(Resolver::Naptr))
Engine::install(new EnumHandler(cfg.getIntValue("general","priority",prio)));
else
Debug(&emodule,DebugGoOn,"NAPTR resolver is not available on this platform");
Debug(&emodule,DebugCrit,"NAPTR resolver is not available on this platform");
}
}; // anonymous namespace

View File

@ -1694,7 +1694,7 @@ bool ExtModHandler::received(Message& msg)
else if (t == "playrec")
typ = ExtModChan::DataBoth;
else {
Debug(DebugGoOn,"Invalid ExtModule method '%s', use 'nochan', 'nodata', 'play', 'record' or 'playrec'",
Debug(DebugConf,"Invalid ExtModule method '%s', use 'nochan', 'nodata', 'play', 'record' or 'playrec'",
t.c_str());
return false;
}
@ -1711,7 +1711,7 @@ bool ExtModHandler::received(Message& msg)
ExtModChan *em = ExtModChan::build(dest.matchString(2).c_str(),
dest.matchString(3).c_str(),typ);
if (!em) {
Debug(DebugGoOn,"Failed to create ExtMod for '%s'",dest.matchString(2).c_str());
Debug(DebugCrit,"Failed to create ExtMod for '%s'",dest.matchString(2).c_str());
return false;
}
ExtModReceiver* recv = em->receiver();

View File

@ -356,7 +356,7 @@ void FaxWrapper::debugName(const char* name)
level |= SPAN_LOG_PROTOCOL_ERROR;
else if (debugAt(DebugWarn))
level |= SPAN_LOG_WARNING;
else if (debugAt(DebugGoOn))
else if (debugAt(DebugCrit))
level |= SPAN_LOG_ERROR;
span_log_set_tag(&m_t30->logging,m_name);
span_log_set_level(&m_t30->logging,level);

View File

@ -981,7 +981,7 @@ BOOL YateGatekeeperServer::Init()
if (AddListener(new H323GatekeeperListener(m_endpoint,*this,name,trans)))
Debug(&hplugin,DebugAll,"Started Gk listener on %s:%d",addr,port);
else
Alarm(&hplugin,"config",DebugGoOn,"Can't start the Gk listener for address: %s",addr);
Alarm(&hplugin,"config",DebugCrit,"Can't start the Gk listener for address: %s",addr);
}
i = s_cfg.getIntValue("gk","ttl",600);
if (i > 0) {
@ -1356,7 +1356,7 @@ bool YateH323EndPoint::startGkClient(int mode, int retry, const char* name)
while (m_thread) {
hplugin.unlock();
if (!--retries) {
Debug(&hplugin,DebugGoOn,
Debug(&hplugin,DebugCrit,
"Endpoint(%s) old Gk client thread not finished [%p]",safe(),this);
return false;
}
@ -1394,7 +1394,7 @@ void YateH323EndPoint::stopGkClient(bool notify, const char* reason, bool waitGk
}
}
if (m_thread) {
Debug(&hplugin,DebugGoOn,"Endpoint(%s) abandoning old Gk client thread (%p) [%p]",
Debug(&hplugin,DebugCrit,"Endpoint(%s) abandoning old Gk client thread (%p) [%p]",
safe(),m_thread,this);
m_thread->setOrphan();
m_thread = 0;
@ -1598,7 +1598,7 @@ bool YateH323EndPoint::checkListener(const NamedList* params, bool& changed)
retries = 1;
}
}
int level = DebugGoOn;
int level = DebugCrit;
String extra;
if (retries) {
level = DebugWarn;
@ -1625,7 +1625,7 @@ bool YateH323EndPoint::checkListener(const NamedList* params, bool& changed)
return true;
}
if (retries)
Alarm(&hplugin,"config",DebugGoOn,"Endpoint(%s) unable to start H323 Listener on %s [%p]",
Alarm(&hplugin,"config",DebugCrit,"Endpoint(%s) unable to start H323 Listener on %s [%p]",
safe(),(const char*)addr.AsString(),this);
String reason = "Cannot listen on ";
reason << m_listenAddr << ":" << m_listenPort;
@ -1700,7 +1700,7 @@ void YateGkRegThread::Main()
m_ep->m_retry = false;
}
hplugin.unlock();
Debug(&hplugin,ok ? DebugAll : DebugGoOn,
Debug(&hplugin,ok ? DebugAll : DebugCrit,
"Endpoint(%s) client thread (%p) finished [%p]",
epName.safe(),this,m_ep);
m_ep = 0;
@ -2196,7 +2196,7 @@ BOOL YateH323Connection::OpenAudioChannel(BOOL isEncoding, unsigned bufferSize,
{
Debug(this,DebugInfo,"YateH323Connection::OpenAudioChannel chan=%p [%p]",m_chan,this);
if (!m_nativeRtp) {
Debug(DebugGoOn,"YateH323Connection::OpenAudioChannel for non-native RTP in [%p]",this);
Debug(DebugCrit,"YateH323Connection::OpenAudioChannel for non-native RTP in [%p]",this);
if (m_needMedia)
ClearCall(EndedByCapabilityExchange);
return FALSE;

View File

@ -269,13 +269,14 @@ public:
debugChain(&__plugin);
MKDEBUG(Fail);
MKDEBUG(Test);
MKDEBUG(Crit);
MKDEBUG(GoOn);
MKDEBUG(Conf);
MKDEBUG(Stub);
MKDEBUG(Warn);
MKDEBUG(Mild);
MKDEBUG(Call);
MKDEBUG(Note);
MKDEBUG(Call);
MKDEBUG(Info);
MKDEBUG(All);
MKTIME(Wall);

View File

@ -418,7 +418,7 @@ SslSocket::SslSocket(SOCKET handle, bool server, int verify, SslContext* context
::SSL_set_fd(m_ssl,handle);
BIO* bio = ::SSL_get_rbio(m_ssl);
if (!(bio && BIO_set_close(bio,BIO_NOCLOSE)))
Debug(&__plugin,DebugGoOn,"SslSocket::SslSocket(%d) no BIO or cannot set NOCLOSE [%p]",
Debug(&__plugin,DebugCrit,"SslSocket::SslSocket(%d) no BIO or cannot set NOCLOSE [%p]",
handle,this);
if (server)
::SSL_set_accept_state(m_ssl);
@ -555,12 +555,12 @@ bool SslHandler::received(Message& msg)
addRand(msg.msgTime());
Socket** ppSock = static_cast<Socket**>(msg.userObject(YATOM("Socket*")));
if (!ppSock) {
Debug(&__plugin,DebugGoOn,"SslHandler: No pointer to Socket");
Debug(&__plugin,DebugCrit,"SslHandler: No pointer to Socket");
return false;
}
Socket* pSock = *ppSock;
if (!pSock) {
Debug(&__plugin,DebugGoOn,"SslHandler: NULL Socket pointer");
Debug(&__plugin,DebugCrit,"SslHandler: NULL Socket pointer");
return false;
}
if (!pSock->valid()) {

View File

@ -221,13 +221,13 @@ CustomTextEdit::CustomTextEdit(const char* name, const NamedList& params, QWidge
m_items.addParam(new CustomTextFormat(String(-1),"white")); // Output() or client set status
m_items.addParam(new CustomTextFormat(String(0),"yellow","red")); // DebugFail - blinking yellow on red
m_items.addParam(new CustomTextFormat(String(1),"yellow","red")); // Unnamed - yellow on red
m_items.addParam(new CustomTextFormat(String(2),"white","red")); // DebugGoOn - white on red
m_items.addParam(new CustomTextFormat(String(2),"white","red")); // DebugCrit - white on red
m_items.addParam(new CustomTextFormat(String(3),"lightgrey","red")); // DebugConf - gray on red
m_items.addParam(new CustomTextFormat(String(4),"red")); // DebugStub - red on black
m_items.addParam(new CustomTextFormat(String(5),"orangered")); // DebugWarn - light red on black
m_items.addParam(new CustomTextFormat(String(6),"yellow")); // DebugMild - yellow on black
m_items.addParam(new CustomTextFormat(String(7),"white")); // DebugCall - white on black
m_items.addParam(new CustomTextFormat(String(8),"lightgreen")); // DebugNote - light green on black
m_items.addParam(new CustomTextFormat(String(7),"lightgreen")); // DebugNote - light green on black
m_items.addParam(new CustomTextFormat(String(8),"white")); // DebugCall - white on black
m_items.addParam(new CustomTextFormat(String(9),"cyan")); // DebugInfo - light cyan on black
m_items.addParam(new CustomTextFormat(String(10),"teal")); // DebugAll - cyan on black
}

View File

@ -2562,11 +2562,11 @@ private:
void stopThreads();
inline unsigned int checkDev(const char* loc) {
return m_devHandle ? 0 :
showError(RadioInterface::NotInitialized,"not open",loc,0,DebugGoOn);
showError(RadioInterface::NotInitialized,"not open",loc,0,DebugCrit);
}
inline unsigned int checkCalStatus(const char* loc) {
return (Calibrating != m_calibrateStatus) ? 0 :
showError(RadioInterface::NotCalibrated,"calibrating",loc,0,DebugGoOn);
showError(RadioInterface::NotCalibrated,"calibrating",loc,0,DebugCrit);
}
inline unsigned int checkPubFuncEntry(bool internal, const char* loc) {
unsigned int status = 0;
@ -3445,7 +3445,7 @@ unsigned int BrfDevTmpAltSet::restore()
"Restored alt interface to %s after '%s' [%p]",
altSetName(m_tmpAltSet),m_oper,m_device->owner());
else
Debug(m_device->owner(),DebugGoOn,
Debug(m_device->owner(),DebugCrit,
"Failed to restore alt interface after '%s': %s [%p]",
m_oper,e.c_str(),m_device->owner());
m_tmpAltSet = BRF_ALTSET_INVALID;
@ -4400,7 +4400,7 @@ unsigned int BrfLibUsbDevice::initialize(const NamedList& params)
return 0;
}
if (status != RadioInterface::Pending)
Debug(m_owner,DebugGoOn,"Failed to initialize: %s [%p]",
Debug(m_owner,DebugCrit,"Failed to initialize: %s [%p]",
e.safe("Unknown error"),m_owner);
return status;
}
@ -5999,7 +5999,7 @@ unsigned int BrfLibUsbDevice::internalSetSampleRate(bool tx, uint32_t value,
// Enforce minimum sample rate
reduceRational(rate);
if (rate.integer < BRF_SAMPLERATE_MIN)
Debug(m_owner,DebugGoOn,
Debug(m_owner,DebugConf,
"Requested %s sample rate %u is smaller than allowed minimum value [%p]",
brfDir(tx),value,m_owner);
// Setup the multisynth enables and index
@ -6808,7 +6808,7 @@ unsigned int BrfLibUsbDevice::syncTransfer(int ep, uint8_t* data, unsigned int l
unsigned int BrfLibUsbDevice::gpioRead(uint8_t addr, uint32_t& value, uint8_t len,
String* error, const char* loc)
{
len = clampInt(len,1,sizeof(value),"GPIO read items",DebugGoOn);
len = clampInt(len,1,sizeof(value),"GPIO read items",DebugCrit);
uint8_t t[sizeof(value)];
unsigned int status = accessPeripheral(UartDevGPIO,false,addr,t,error,len,loc);
if (status)
@ -6835,9 +6835,9 @@ unsigned int BrfLibUsbDevice::gpioWrite(uint8_t addr, uint32_t value, uint8_t le
else if (m_devSpeed == LIBUSB_SPEED_HIGH)
value |= BRF_GPIO_SMALL_DMA_XFER;
else
Debug(m_owner,DebugGoOn,"GPIO write: unhandled speed [%p]",m_owner);
Debug(m_owner,DebugStub,"GPIO write: unhandled speed [%p]",m_owner);
}
len = clampInt(len,1,sizeof(value),"GPIO write items",DebugGoOn);
len = clampInt(len,1,sizeof(value),"GPIO write items",DebugCrit);
uint8_t t[sizeof(value)];
// Data is in little endian order
#ifdef LITTLE_ENDIAN
@ -8035,7 +8035,7 @@ void BrfLibUsbDevice::initBuffers(bool* txSet, unsigned int totalSamples, unsign
for (unsigned int i = 0; !lck.devLocked() && i < 3; i++)
lck.wait(&error,1000000);
if (!lck.devLocked()) {
Debug(m_owner,DebugGoOn,"Failed to initialize %s buffers: serialize [%p]",
Debug(m_owner,DebugCrit,"Failed to initialize %s buffers: serialize [%p]",
brfDir(tx),m_owner);
continue;
}
@ -8123,7 +8123,7 @@ void BrfLibUsbDevice::ioBufCheckLimit(bool tx, unsigned int nBufs)
}
}
if (invalid)
Debug(m_owner,DebugGoOn,"%s: sample value out of range buffers=%u:%s [%p]",
Debug(m_owner,DebugConf,"%s: sample value out of range buffers=%u:%s [%p]",
brfDir(tx),nBufs,invalid.c_str(),m_owner);
}
@ -10218,7 +10218,7 @@ void BrfLibUsbDevice::stopThreads()
unsigned int BrfLibUsbDevice::waitCancel(const char* loc, const char* reason,
String* error)
{
Debug(m_owner,DebugGoOn,"%s: %s. Waiting for cancel... [%p]",loc,reason,m_owner);
Debug(m_owner,DebugCrit,"%s: %s. Waiting for cancel... [%p]",loc,reason,m_owner);
unsigned int status = 0;
while (!status && !m_calibrateStop) {
Thread::idle();

View File

@ -338,13 +338,13 @@ bool RManagerListener::initSocket()
m_socket.create(AF_INET, SOCK_STREAM);
if (!m_socket.valid()) {
Alarm("RManager","socket",DebugGoOn,"Unable to create the listening socket: %s",
Alarm("RManager","socket",DebugCrit,"Unable to create the listening socket: %s",
strerror(m_socket.error()));
return false;
}
if (!m_socket.setBlocking(false)) {
Alarm("RManager","socket",DebugGoOn, "Failed to set listener to nonblocking mode: %s",
Alarm("RManager","socket",DebugCrit, "Failed to set listener to nonblocking mode: %s",
strerror(m_socket.error()));
return false;
}
@ -355,12 +355,12 @@ bool RManagerListener::initSocket()
m_address << sa.host() << ":" << sa.port();
m_socket.setReuse();
if (!m_socket.bind(sa)) {
Alarm("RManager","socket",DebugGoOn,"Failed to bind to %s : %s",
Alarm("RManager","socket",DebugCrit,"Failed to bind to %s : %s",
m_address.c_str(),strerror(m_socket.error()));
return false;
}
if (!m_socket.listen(2)) {
Alarm("RManager","socket",DebugGoOn,"Unable to listen on socket: %s",
Alarm("RManager","socket",DebugCrit,"Unable to listen on socket: %s",
strerror(m_socket.error()));
return false;
}
@ -420,7 +420,7 @@ Connection* RManagerListener::checkCreate(Socket* sock, const char* addr)
}
}
else if (!sock->setBlocking(false)) {
Debug("RManager",DebugGoOn, "Failed to set tcp socket to nonblocking mode: %s",
Debug("RManager",DebugCrit, "Failed to set tcp socket to nonblocking mode: %s",
strerror(sock->error()));
delete sock;
return 0;

View File

@ -1069,7 +1069,7 @@ void Cache::adjustToLimit(CacheItem* skipAdded)
m_count--;
continue;
}
Debug(&__plugin,DebugGoOn,
Debug(&__plugin,DebugCrit,
"Cache(%s) can't find the oldest item count=%u limit=%u [%p]",
m_name.c_str(),m_count,m_limit,this);
m_count = m_list.count();

View File

@ -366,7 +366,7 @@ int MyConn::queryDbInternal(DbQuery* query)
if (columns[c])
columns[c]->set(new String(fields[c].name));
else
Debug(&module,DebugGoOn,"No array for column %u",c);
Debug(&module,DebugCrit,"No array for column %u",c);
}
// and now data row by row
for (unsigned int r = 1; r <= rows; r++) {
@ -480,7 +480,7 @@ int MyAcct::initConns()
mySqlConn->m_conn = mysql_init(mySqlConn->m_conn);
if (!mySqlConn->m_conn) {
Debug(&module,DebugGoOn,"Could not start connection %d for '%s'",i,c_str());
Debug(&module,DebugCrit,"Could not start connection %d for '%s'",i,c_str());
return i;
}
DDebug(&module,DebugAll,"Connection '%s' for account '%s' was created",mySqlConn->c_str(),c_str());

View File

@ -214,7 +214,7 @@ bool PgConn::initDbInternal(int retry)
u_int64_t timeout = Time::now() + m_account->m_timeout;
m_conn = PQconnectStart(m_account->m_connection.c_str());
if (!m_conn) {
Debug(&module,DebugGoOn,"Could not start connection for '%s' [%p]",c_str(),m_account);
Debug(&module,DebugCrit,"Could not start connection for '%s' [%p]",c_str(),m_account);
return false;
}
PQsetnonblocking(m_conn,1);
@ -351,7 +351,7 @@ int PgConn::queryDbInternal(const char* query, Message* dest)
if (column)
column->set(new String(PQfname(res,k)));
else {
Debug(&module,DebugGoOn,
Debug(&module,DebugCrit,
"Query '%s' for '%s': No array column for %d [%p]",
query,c_str(),k,m_account);
continue;
@ -360,7 +360,7 @@ int PgConn::queryDbInternal(const char* query, Message* dest)
column = column->next();
if (!column) {
// Stop now: we won't get the next row
Debug(&module,DebugGoOn,
Debug(&module,DebugCrit,
"Query '%s' for '%s': No array row %d in column %d [%p]",
query,c_str(),j + 1,k,m_account);
break;

View File

@ -501,7 +501,7 @@ bool ListenerThread::addAddress(const NamedList &param)
}
SctpSocket* s = static_cast<SctpSocket*>(m_socket);
if (!s) {
Debug("ListenerThread",DebugGoOn,"Failed to cast socket");
Debug("ListenerThread",DebugCrit,"Failed to cast socket");
return false;
}
if (!s->bindx(o)) {
@ -884,7 +884,7 @@ bool Transport::addAddress(const NamedList &param, Socket* socket)
}
SctpSocket* s = static_cast<SctpSocket*>(socket);
if (!s) {
Debug(this,DebugGoOn,"Failed to cast socket");
Debug(this,DebugCrit,"Failed to cast socket");
return false;
}
if (!s->bindx(o)) {
@ -992,7 +992,7 @@ bool Transport::connectSocket()
}
SctpSocket* s = static_cast<SctpSocket*>(sock);
if (!s) {
Debug(this,DebugGoOn,"Failed to cast socket");
Debug(this,DebugCrit,"Failed to cast socket");
return false;
}
if (!s->connectx(o)) {
@ -1228,7 +1228,7 @@ bool StreamReader::sendBuffer(int streamId)
if (m_transport->transType() == Transport::Sctp) {
SctpSocket* s = static_cast<SctpSocket*>(m_socket);
if (!s) {
Debug(m_transport,DebugGoOn,"Sctp conversion failed");
Debug(m_transport,DebugCrit,"Sctp conversion failed");
return false;
}
if (m_transport->status() == Transport::Up)
@ -1310,7 +1310,7 @@ bool StreamReader::readData()
if (m_transport->transType() == Transport::Sctp) {
SctpSocket* s = static_cast<SctpSocket*>(m_socket);
if (!s) {
Debug(m_transport,DebugGoOn,"Sctp conversion failed");
Debug(m_transport,DebugCrit,"Sctp conversion failed");
return false;
}
len = s->recvMsg((void*)buf,m_headerLen,addr,stream,flags);
@ -1369,7 +1369,7 @@ bool StreamReader::readData()
if (m_transport->transType() == Transport::Sctp) {
SctpSocket* s = static_cast<SctpSocket*>(m_socket);
if (!s) {
Debug(m_transport,DebugGoOn,"Sctp conversion failed");
Debug(m_transport,DebugCrit,"Sctp conversion failed");
return false;
}
len = s->recvMsg((void*)buf1,m_totalPacketLen,addr,stream,flags);
@ -1548,7 +1548,7 @@ bool MessageReader::sendMSG(const DataBlock& header, const DataBlock& msg, int s
if (m_transport->transType() == Transport::Sctp) {
SctpSocket* s = static_cast<SctpSocket*>(m_socket);
if (!s) {
Debug(m_transport,DebugGoOn,"Sctp conversion failed");
Debug(m_transport,DebugCrit,"Sctp conversion failed");
break;
}
int flags = 0;
@ -1617,7 +1617,7 @@ bool MessageReader::readData()
int flags = 0;
SctpSocket* s = static_cast<SctpSocket*>(m_socket);
if (!s) {
Debug(m_transport,DebugGoOn,"Sctp conversion failed");
Debug(m_transport,DebugCrit,"Sctp conversion failed");
return false;
}
SocketAddr addr;

View File

@ -1773,7 +1773,7 @@ int WpSpan::readData()
if (r == -1)
return -1;
if (r < WP_HEADER) {
Debug(m_group,DebugGoOn,"WpSpan('%s'). Short read %u byte(s) [%p]",
Debug(m_group,DebugCrit,"WpSpan('%s'). Short read %u byte(s) [%p]",
id().safe(),r,this);
return -1;
}
@ -1783,9 +1783,8 @@ int WpSpan::readData()
unsigned char err = m_buffer[WP_RD_ERROR];
#endif
if (err) {
m_readErrors++;
if (m_readErrors == MAX_READ_ERRORS) {
Debug(m_group,DebugGoOn,"WpSpan('%s'). Read error 0x%02X [%p]",
if (++m_readErrors >= MAX_READ_ERRORS) {
Debug(m_group,DebugCrit,"WpSpan('%s'). Read error 0x%02X [%p]",
id().safe(),err,this);
m_readErrors = 0;
}

View File

@ -1230,14 +1230,13 @@ int WpSpan::readData()
if (r == -1)
return -1;
if (r < WP_HEADER) {
Debug(m_group,DebugGoOn,"WpSpan('%s'). Short read %u byte(s) [%p]",
Debug(m_group,DebugCrit,"WpSpan('%s'). Short read %u byte(s) [%p]",
id().safe(),r,this);
return -1;
}
if (SANG_STATUS_SUCCESS != m_buffer.api_header.operation_status) {
m_readErrors++;
if (m_readErrors == MAX_READ_ERRORS) {
Debug(m_group,DebugGoOn,"WpSpan('%s'). Read error %u (%s) [%p]",
if (++m_readErrors >= MAX_READ_ERRORS) {
Debug(m_group,DebugCrit,"WpSpan('%s'). Read error %u (%s) [%p]",
id().safe(),m_buffer.api_header.operation_status,
SDLA_DECODE_SANG_STATUS(m_buffer.api_header.operation_status),this);
m_readErrors = 0;

View File

@ -633,7 +633,7 @@ RadAttrib::RadAttrib(const char* name, const char* value)
return;
m_type = find(name,&m_vendor);
if (!m_type) {
Debug(&__plugin,DebugGoOn,"Failed to find item %s in dictionary",name);
Debug(&__plugin,DebugWarn,"Failed to find item %s in dictionary",name);
return;
}
assign(value);
@ -647,7 +647,7 @@ RadAttrib::RadAttrib(const char* name, int value)
return;
m_type = find(name,&m_vendor);
if (!m_type) {
Debug(&__plugin,DebugGoOn,"Failed to find item %s in dictionary",name);
Debug(&__plugin,DebugWarn,"Failed to find item %s in dictionary",name);
return;
}
assign(value);
@ -660,7 +660,7 @@ RadAttrib::RadAttrib(const char* name, unsigned char subType, const char* value)
return;
m_type = find(name,&m_vendor);
if (!m_type) {
Debug(&__plugin,DebugGoOn,"Failed to find item %s in dictionary",name);
Debug(&__plugin,DebugWarn,"Failed to find item %s in dictionary",name);
return;
}
assign(subType,value);
@ -699,7 +699,7 @@ bool RadAttrib::assign(const char* value)
}
break;
default:
Debug(&__plugin,DebugGoOn,"Ignoring unknown attribute of type %d",m_type->type);
Debug(&__plugin,DebugWarn,"Ignoring unknown attribute of type %d",m_type->type);
return false;
}
return true;
@ -729,7 +729,7 @@ bool RadAttrib::assign(int value)
}
break;
default:
Debug(&__plugin,DebugGoOn,"Ignoring unknown attribute of type %d",m_type->type);
Debug(&__plugin,DebugWarn,"Ignoring unknown attribute of type %d",m_type->type);
return false;
}
return true;
@ -965,7 +965,7 @@ int RadiusClient::makeRequest(int port, unsigned char request, unsigned char* re
}
int datalen = 20 + attrdata.length();
if (datalen > RADIUS_MAXLEN) {
Debug(&__plugin,DebugGoOn,"Packet of %u bytes exceeds RADIUS maximum",datalen);
Debug(&__plugin,DebugWarn,"Packet of %u bytes exceeds RADIUS maximum %u",datalen,RADIUS_MAXLEN);
return UnknownErr;
}
@ -1009,7 +1009,7 @@ int RadiusClient::makeRequest(int port, unsigned char request, unsigned char* re
// we have the data ready, send it and wait for an answer
for (int r = m_retries; r > 0; r--) {
if (socket()->sendTo(radpckt.data(),radpckt.length(),sockAddr) == Socket::socketError()) {
Alarm(&__plugin,"socket",DebugGoOn,"Packet sending error %d to %s:%d",
Alarm(&__plugin,"socket",DebugCrit,"Packet sending error %d to %s:%d",
socket()->error(),sockAddr.host().c_str(),sockAddr.port());
return UnknownErr;
}
@ -1692,11 +1692,11 @@ void RadiusModule::initialize()
// we only have UDP support
if (!s_localSock.create(PF_INET,SOCK_DGRAM,IPPROTO_IP)) {
Alarm(this,"socket",DebugGoOn,"Error creating socket. Radius functions unavailable");
Alarm(this,"socket",DebugCrit,"Error creating socket. Radius functions unavailable");
return;
}
if (!s_localSock.bind(s_localAddr)) {
Alarm(this,"socket",DebugWarn,"Error %d binding to %s:%d. Radius functions unavailable",
Alarm(this,"socket",DebugCrit,"Error %d binding to %s:%d. Radius functions unavailable",
s_localSock.error(),s_localAddr.host().c_str(),s_localAddr.port());
return;
}

View File

@ -2514,7 +2514,7 @@ void SigDriver::handleEvent(SignallingEvent* event)
return;
}
if (!event->message() && event->type() != SignallingEvent::Circuit) {
Debug(this,DebugGoOn,"Received event (%p,'%s') without message",event,event->name());
Debug(this,DebugCrit,"Received event (%p,'%s') without message",event,event->name());
return;
}
// Ok. Send the message to the channel if we have one
@ -2820,7 +2820,7 @@ bool SigDriver::appendOnDemand(SignallingComponent* cmp, int type)
return false;
Lock lock(m_onDemandMutex);
if (m_onDemand.find(sccp->toString())) {
Debug(this,DebugGoOn,"Request to append duplicat of on demand component (%p): '%s'.",
Debug(this,DebugCrit,"Request to append duplicate of on demand component (%p): '%s'.",
cmp,cmp->toString().c_str());
return false;
}

View File

@ -2078,7 +2078,7 @@ bool ZapSpan::init(ZapDevice::Type type, unsigned int offset,
continue;
}
TelEngine::destruct(cic);
Debug(m_group,DebugGoOn,
Debug(m_group,DebugConf,
"ZapSpan('%s'). Duplicate circuit code=%u (channel=%u) [%p]",
id().safe(),code,channel,this);
}

View File

@ -673,7 +673,7 @@ static bool encodeParam(const Parameter* param, DataBlock& data, XmlElement* ele
!(param->type == TcapXApplication::HexString || param->type == TcapXApplication::SequenceOf
|| param->type == TcapXApplication::Sequence || param->type == TcapXApplication::Choice
|| param->type == TcapXApplication::SetOf))
Debug(&__plugin,DebugGoOn,"Encoding definition conflict for param='%s', tag is defined as contructor"
Debug(&__plugin,DebugCrit,"Encoding definition conflict for param='%s', tag is defined as contructor"
" while its type is primitive",param->name.c_str());
ok = type->encode(param,type,data,child,err);
}
@ -7272,7 +7272,7 @@ bool XMLConnListener::createConn(Socket* skt, String& addr)
return false;
}
if (!skt->setBlocking(false)) {
Debug(m_user,DebugGoOn, "Failed to set TCP socket to nonblocking mode: %s",
Debug(m_user,DebugCrit, "Failed to set TCP socket to nonblocking mode: %s",
strerror(skt->error()));
delete skt;
return false;

View File

@ -573,7 +573,7 @@ const short* ToneData::data()
}
short* dat = (short*)::malloc((len+1)*sizeof(short));
if (!dat) {
Debug(&__plugin,DebugGoOn,"ToneData::data() cold not allocate memory for %d elements",len);
Debug(&__plugin,DebugCrit,"ToneData::data() cold not allocate memory for %d elements",len);
return 0;
}
short* tmp = dat;

View File

@ -782,7 +782,7 @@ Disconnector::~Disconnector()
bool Disconnector::init()
{
if (error() || !startup()) {
Debug(&__plugin,DebugGoOn,"Error starting disconnector thread %p",this);
Debug(&__plugin,DebugCrit,"Error starting disconnector thread %p",this);
delete this;
return false;
}

View File

@ -458,11 +458,11 @@ YRTPWrapper::~YRTPWrapper()
TelEngine::destruct(m_udptl);
}
if (m_source) {
Debug(&splugin,DebugGoOn,"There is still a RTP source %p [%p]",m_source,this);
Debug(&splugin,DebugCrit,"There is still a RTP source %p [%p]",m_source,this);
TelEngine::destruct(m_source);
}
if (m_consumer) {
Debug(&splugin,DebugGoOn,"There is still a RTP consumer %p [%p]",m_consumer,this);
Debug(&splugin,DebugCrit,"There is still a RTP consumer %p [%p]",m_consumer,this);
TelEngine::destruct(m_consumer);
}
splugin.changed();
@ -1158,7 +1158,7 @@ YRTPSource::~YRTPSource()
tmp->m_source = 0;
s_srcMutex.unlock();
if (s != this)
Debug(&splugin,DebugGoOn,"Wrapper %p held source %p not [%p]",tmp,s,this);
Debug(&splugin,DebugCrit,"Wrapper %p held source %p not [%p]",tmp,s,this);
// we have just to wait for any YRTPSession::rtpRecvData() to finish
while (m_busy)
Thread::yield();
@ -1192,7 +1192,7 @@ YRTPConsumer::~YRTPConsumer()
tmp->m_consumer = 0;
tmp->deref();
if (c != this)
Debug(&splugin,DebugGoOn,"Wrapper %p held consumer %p not [%p]",tmp,c,this);
Debug(&splugin,DebugCrit,"Wrapper %p held consumer %p not [%p]",tmp,c,this);
}
}

View File

@ -8966,7 +8966,7 @@ bool SIPDriver::received(Message& msg, int id)
m_endpoint->m_mutex.lock();
n = m_endpoint->m_transports.count();
if (n)
Debug(this,DebugGoOn,"Exiting with %u transports in queue",n);
Debug(this,DebugCrit,"Exiting with %u transports in queue",n);
m_endpoint->m_mutex.unlock();
m_endpoint->cancel();
}

View File

@ -1899,7 +1899,7 @@ SOCKSPacket* SOCKSConn::processSocks(const Time& now, bool& error, bool& timeout
return 0;
// Sanity check
if (!m_waitMsg) {
Debug(m_engine,DebugGoOn,
Debug(m_engine,DebugCrit,
"SOCKSConn(%s) inconsistent status (no msg in %s status) [%p]",
m_id.c_str(),statusName(m_status),this);
error = true;
@ -3447,7 +3447,7 @@ bool YSocksWrapper::startWorker()
if (m_thread->startup())
return true;
m_thread = 0;
Debug(this,DebugGoOn,"Failed to start worker thread [%p]",this);
Debug(this,DebugCrit,"Failed to start worker thread [%p]",this);
return false;
}

View File

@ -1010,7 +1010,7 @@ bool YStunSocketFilter::install(Socket* sock, const Message* msg)
m_userId = msg->getValue("userid");
// Install
if (!sock->installFilter(this)) {
Debug(&iplugin,DebugGoOn,
Debug(&iplugin,DebugCrit,
"Error installing filter for '%s'. [%p]",
m_userId.c_str(),this);
return false;
@ -1195,7 +1195,7 @@ bool StunHandler::received(Message& msg)
{
Socket* socket = static_cast<Socket*>(msg.userObject(YATOM("Socket")));
if (!socket) {
Debug(&iplugin,DebugGoOn,"StunHandler: No socket to install filter for.");
Debug(&iplugin,DebugWarn,"StunHandler: No socket to install filter for.");
return true;
}
YStunSocketFilter* filter = new YStunSocketFilter();

View File

@ -449,7 +449,7 @@ bool ZLibModule::received(Message& msg, int id)
return true;
Compressor** pp = static_cast<Compressor**>(msg.userObject(YATOM("Compressor*")));
if (!pp) {
Debug(this,DebugGoOn,"No pointer in %s message",msg.c_str());
Debug(this,DebugWarn,"No pointer in %s message",msg.c_str());
return false;
}
bool comp = msg.getBoolValue("comp",true);

View File

@ -254,13 +254,14 @@ YATE_API bool abortOnBug(bool doAbort);
enum DebugLevel {
DebugFail = 0,
DebugTest = 1,
DebugGoOn = 2,
DebugCrit = 2,
DebugGoOn = DebugCrit,
DebugConf = 3,
DebugStub = 4,
DebugWarn = 5,
DebugMild = 6,
DebugCall = 7,
DebugNote = 8,
DebugNote = 7,
DebugCall = 8,
DebugInfo = 9,
DebugAll = 10
};