[11604] Drop outDebugInLine, outMenu.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Vinolentus 2011-06-05 17:54:36 +04:00 committed by VladimirMangos
parent b68a88573f
commit d99e9dc611
4 changed files with 39 additions and 87 deletions

View file

@ -414,10 +414,16 @@ class ByteBuffer
if (!sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) // optimize disabled debug output
return;
sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); ++i)
sLog.outDebugInLine("%u - ", read<uint8>(i) );
sLog.outDebug(" ");
std::ostringstream ss;
ss << "STORAGE_SIZE: " << size() << "\n";
if (sLog.IsIncludeTime())
ss << " ";
for (size_t i = 0; i < size(); ++i)
ss << uint32(read<uint8>(i)) << " - ";
sLog.outDebug(ss.str().c_str());
}
void textlike() const
@ -425,10 +431,16 @@ class ByteBuffer
if (!sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) // optimize disabled debug output
return;
sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); ++i)
sLog.outDebugInLine("%c", read<uint8>(i) );
sLog.outDebug(" ");
std::ostringstream ss;
ss << "STORAGE_SIZE: " << size() << "\n";
if (sLog.IsIncludeTime())
ss << " ";
for (size_t i = 0; i < size(); ++i)
ss << read<uint8>(i);
sLog.outDebug(ss.str().c_str());
}
void hexlike() const
@ -436,37 +448,40 @@ class ByteBuffer
if (!sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) // optimize disabled debug output
return;
uint32 j = 1, k = 1;
sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
std::ostringstream ss;
ss << "STORAGE_SIZE: " << size() << "\n";
if (sLog.IsIncludeTime())
sLog.outDebugInLine(" ");
ss << " ";
for(uint32 i = 0; i < size(); ++i)
size_t j = 1, k = 1;
for (size_t i = 0; i < size(); ++i)
{
if ((i == (j * 8)) && ((i != (k * 16))))
{
sLog.outDebugInLine("| %02X ", read<uint8>(i));
ss << "| ";
++j;
}
else if (i == (k * 16))
{
sLog.outDebugInLine("\n");
if(sLog.IsIncludeTime())
sLog.outDebugInLine(" ");
ss << "\n";
sLog.outDebugInLine("%02X ", read<uint8>(i));
if (sLog.IsIncludeTime())
ss << " ";
++k;
++j;
}
else
{
sLog.outDebugInLine("%02X ", read<uint8>(i));
}
char buf[4];
snprintf(buf, 4, "%02X", read<uint8>(i));
ss << buf << " ";
}
sLog.outDebugInLine("\n");
sLog.outDebug(ss.str().c_str());
}
private:
// limited for internal use because can "append" any unexpected type (like pointer and etc) with hard detection problem
template <typename T> void append(T value)

View file

@ -589,34 +589,6 @@ void Log::outDetail( const char * str, ... )
fflush(stdout);
}
void Log::outDebugInLine( const char * str, ... )
{
if (!str)
return;
if (m_logLevel >= LOG_LVL_DEBUG)
{
if (m_colored)
SetColor(true,m_colors[LogDebug]);
va_list ap;
va_start(ap, str);
vutf8printf(stdout, str, &ap);
va_end(ap);
if (m_colored)
ResetColor(true);
}
if (logfile && m_logFileLevel >= LOG_LVL_DEBUG)
{
va_list ap;
va_start(ap, str);
vfprintf(logfile, str, ap);
va_end(ap);
}
}
void Log::outDebug( const char * str, ... )
{
if (!str)
@ -770,38 +742,6 @@ void Log::outCharDump( const char * str, uint32 account_id, uint32 guid, const c
}
}
void Log::outMenu( const char * str, ... )
{
if (!str)
return;
SetColor(true,m_colors[LogNormal]);
if (m_includeTime)
outTime();
va_list ap;
va_start(ap, str);
vutf8printf(stdout, str, &ap);
va_end(ap);
ResetColor(true);
if (logfile)
{
outTimestamp(logfile);
va_start(ap, str);
vfprintf(logfile, str, ap);
va_end(ap);
fprintf(logfile, "\n" );
fflush(logfile);
}
fflush(stdout);
}
void Log::outRALog( const char * str, ... )
{
if (!str)

View file

@ -130,11 +130,8 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
// log level >= 2
void outDetail( const char * str, ... ) ATTR_PRINTF(2,3);
// log level >= 3
void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3);
// log level >= 3
void outDebug( const char * str, ... ) ATTR_PRINTF(2,3);
// any log level
void outMenu( const char * str, ... ) ATTR_PRINTF(2,3);
void outErrorDb(); // any log level
// any log level
void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11603"
#define REVISION_NR "11604"
#endif // __REVISION_NR_H__