static bool DebugPrintfV()

in host/log/logger.cpp [1434:1495]


static bool DebugPrintfV( SV_LOG_LEVEL LogLevel, const char* format, va_list args )
{
    std::vector<char> szDebugString(MAX_LOG_BUFFER_SIZE, 0);        

    static bool LogOptionInitialized = false;

    static bool bStdError  = false;
    static bool bStdOutput = false;
    static bool bConsoleCheck = false;
    

    if (!bConsoleCheck && !isDaemon)
    {
        if ( GetStdHandle(STD_ERROR_HANDLE) )  
            bStdError   = true;
        if ( GetStdHandle(STD_OUTPUT_HANDLE) ) 
            bStdOutput  = true;
        bConsoleCheck = true;
    }           


    if( 0 == lstrlenA( format ) )
    {
        return( false );
    }

    _vsnprintf_s(&szDebugString[0], szDebugString.size(), szDebugString.size() - 1, format, args);

    if( 0 == lstrlenA( &szDebugString[0] ) )
    {
        return( false );
    }
    
    if ( (nRemoteLogLevel != SV_LOG_DISABLE) && (nRemoteLogLevel >= LogLevel) )
    {
        if( serializerType == PHPSerialize )
        {
            if(!CxServerIpAddress.empty())
            DebugPrintfToCx(CxServerIpAddress.c_str(), CxServerPort, LOGGER_URL, LogLevel, &szDebugString[0],isHttps);
        }
        else if( serializerType == Xmlize && localhostlogfile.length() > 0 )
        {
            DebugPrintfToLocalHostLog(LogLevel, &szDebugString[0]) ;
        }
    }    
    
    if (bStdError  && ( (SV_LOG_ERROR == LogLevel) || (SV_LOG_SEVERE == LogLevel) || (SV_LOG_FATAL == LogLevel) ) )         
    {
        cerr << &szDebugString[0] ;
    }
    else if( bStdOutput && (SV_LOG_INFO == LogLevel))
    {
        cout << &szDebugString[0] ;
    }

    if (nLogLevel != SV_LOG_DISABLE)
    {
        OutputDebugStringToLog((int)LogLevel, &szDebugString[0]);
    }

    return( true );
}