aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Logging/Log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Logging/Log.cpp')
-rw-r--r--src/server/shared/Logging/Log.cpp51
1 files changed, 42 insertions, 9 deletions
diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp
index 500701d0491..6857ea649bb 100644
--- a/src/server/shared/Logging/Log.cpp
+++ b/src/server/shared/Logging/Log.cpp
@@ -734,16 +734,49 @@ void Log::outDebug(const char * str, ...)
fflush(stdout);
}
-void Log::outStaticDebug(const char * fmt, ...)
+void Log::outStaticDebug(const char * str, ...)
{
- #ifdef TRINITY_DEBUG
- va_list ap;
- char str[2048];
- va_start(ap, str);
- vsnprintf(str, 2048, fmt, ap);
- va_end(ap);
- outDebug(str);
- #endif
+ if (!str)
+ return;
+
+ if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL)
+ {
+ va_list ap2;
+ va_start(ap2, str);
+ char nnew_str[MAX_QUERY_LEN];
+ vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
+ outDB(LOG_TYPE_DEBUG, nnew_str);
+ va_end(ap2);
+ }
+
+ if( m_logLevel > LOGL_DETAIL )
+ {
+ if (m_colored)
+ SetColor(true,m_colors[LOGL_DEBUG]);
+
+ va_list ap;
+ va_start(ap, str);
+ vutf8printf(stdout, str, &ap);
+ va_end(ap);
+
+ if(m_colored)
+ ResetColor(true);
+
+ printf( "\n" );
+
+ if (logfile)
+ {
+ outTimestamp(logfile);
+ va_list ap;
+ va_start(ap, str);
+ vfprintf(logfile, str, ap);
+ va_end(ap);
+
+ fprintf(logfile, "\n" );
+ fflush(logfile);
+ }
+ }
+ fflush(stdout);
}
void Log::outStringInLine(const char * str, ...)