Ejemplo n.º 1
0
/**
    Flush active log target, if any.
*/
/* static */ void mx::Log::Flush()
{
    if (GetActiveTarget())
    {
        GetActiveTarget()->Flush();
    }
}
Ejemplo n.º 2
0
/* static */
void wxLog::OnLog(wxLogLevel level, const wxChar *szString, time_t t)
{
    if ( IsEnabled() && ms_logLevel >= level )
    {
        wxLog *pLogger = GetActiveTarget();
        if ( pLogger )
        {
            if ( GetRepetitionCounting() )
            {
                wxCRIT_SECT_LOCKER(lock, gs_prevCS);

                if ( szString == ms_prevString )
                {
                    ms_prevCounter++;

                    // nothing else to do, in particular, don't log the
                    // repeated message
                    return;
                }

                pLogger->LogLastRepeatIfNeededUnlocked();

                // reset repetition counter for a new message
                ms_prevString = szString;
                ms_prevLevel = level;
                ms_prevTimeStamp = t;
            }

            pLogger->DoLog(level, szString, t);
        }
    }
}
Ejemplo n.º 3
0
/* static */
void wxLog::FlushActive()
{
    if ( ms_suspendCount )
        return;

    wxLog * const log = GetActiveTarget();
    if ( log )
    {
#if wxUSE_THREADS
        if ( wxThread::IsMain() )
            log->FlushThreadMessages();
#endif // wxUSE_THREADS

        log->Flush();
    }
}
Ejemplo n.º 4
0
/* static */
unsigned wxLog::DoLogNumberOfRepeats()
{
    wxLog * const pLogger = GetActiveTarget();
    return pLogger ? pLogger->LogLastRepeatIfNeeded() : 0u;
}