Core: Fix more warnings, add new function sLog.outStaticDebug() that replaces DEBUG_LOG

--HG--
branch : trunk
This commit is contained in:
click
2010-08-22 01:57:04 +02:00
parent a40cb46e61
commit 670964803f
29 changed files with 171 additions and 171 deletions

View File

@@ -59,7 +59,7 @@ bool DatabaseWorkerPool::Open(const std::string& infoString, uint8 num_threads)
void DatabaseWorkerPool::Close()
{
DEBUG_LOG("Closing down %u connections on this DatabaseWorkerPool", (uint32)m_connections.value());
sLog.outStaticDebug("Closing down %u connections on this DatabaseWorkerPool", (uint32)m_connections.value());
/// Shuts down worker threads for this connection pool.
ACE_Thread_Mutex shutdown_Mtx;
ACE_Condition_Thread_Mutex m_condition(shutdown_Mtx);
@@ -75,14 +75,14 @@ void DatabaseWorkerPool::Close()
delete m_bundle_conn;
m_bundle_conn = NULL;
--m_connections;
DEBUG_LOG("Closed bundled connection.");
sLog.outStaticDebug("Closed bundled connection.");
//- MySQL::Thread_End() should be called manually from the aborting calling threads
DEBUG_LOG("Waiting for %u synchroneous database threads to exit.", (uint32)m_connections.value());
sLog.outStaticDebug("Waiting for %u synchroneous database threads to exit.", (uint32)m_connections.value());
while (!m_sync_connections.empty())
{
}
DEBUG_LOG("Synchroneous database threads exited succesfuly.");
sLog.outStaticDebug("Synchroneous database threads exited succesfuly.");
mysql_library_end();
}

View File

@@ -49,14 +49,14 @@
# define DECLSPEC_NORETURN
#endif //PLATFORM
#if !defined(DEBUG)
#if !defined(COREDEBUG)
# define TRINITY_INLINE inline
#else //DEBUG
#else //COREDEBUG
# if !defined(TRINITY_DEBUG)
# define TRINITY_DEBUG
# endif //TRINITY_DEBUG
# define TRINITY_INLINE
#endif //!DEBUG
#endif //!COREDEBUG
#if COMPILER == COMPILER_GNU
# define ATTR_NORETURN __attribute__((noreturn))
@@ -75,11 +75,4 @@ typedef ACE_UINT32 uint32;
typedef ACE_UINT16 uint16;
typedef ACE_UINT8 uint8;
#if COMPILER != COMPILER_MICROSOFT
typedef uint16 WORD;
typedef uint32 DWORD;
#endif //COMPILER
typedef uint64 OBJECT_HANDLE;
#endif //TRINITY_DEFINE_H

View File

@@ -734,6 +734,18 @@ void Log::outDebug(const char * str, ...)
fflush(stdout);
}
void Log::outStaticDebug(const char * fmt, ...)
{
#ifdef TRINITY_DEBUG
va_list ap;
char str[2048];
va_start(ap, str);
vsnprintf(str, 2048, fmt, ap);
va_end(ap);
outDebug(str);
#endif
}
void Log::outStringInLine(const char * str, ...)
{
if (!str)

View File

@@ -104,6 +104,7 @@ class Log
void outBasic( const char * str, ... ) ATTR_PRINTF(2,3);
void outDetail( const char * str, ... ) ATTR_PRINTF(2,3);
void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
void outStaticDebug( const char * str, ... ) ATTR_PRINTF(2,3);
void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3);
void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);
void outChar( const char * str, ... ) ATTR_PRINTF(2,3);
@@ -174,11 +175,5 @@ class Log
#define sLog (*ACE_Singleton<Log, ACE_Thread_Mutex>::instance())
#ifdef TRINITY_DEBUG
#define DEBUG_LOG sLog.outDebug
#else
#define DEBUG_LOG
#endif
#endif