Ejemplo n.º 1
0
void
FlushEngine::flushAll(const FlushContext::List &lst)
{
    LOG(debug, "%ld targets to flush.", lst.size());
    for (const FlushContext::SP & ctx : lst) {
        if (wait(0)) {
            if (ctx->initFlush()) {
                logTarget("initiated", *ctx);
                _executor.execute(std::make_unique<FlushTask>(initFlush(*ctx), *this, ctx));
            } else {
                logTarget("failed to initiate", *ctx);
            }
        }
    }
}
Ejemplo n.º 2
0
void dumpLogging()
{
    QString output = "Current Logging Categories:";
    output += "\n\t logging: "      + QString::number(logLogging().isDebugEnabled());
    output += "\n\t keybinds: "     + QString::number(logKeybinds().isDebugEnabled());
    output += "\n\t settings: "     + QString::number(logSettings().isDebugEnabled());
    output += "\n\t gui: "          + QString::number(logGUI().isDebugEnabled());
    output += "\n\t teams: "        + QString::number(logTeams().isDebugEnabled());
    output += "\n\t db: "           + QString::number(logDB().isDebugEnabled());
    output += "\n\t input: "        + QString::number(logInput().isDebugEnabled());
    output += "\n\t position: "     + QString::number(logPosition().isDebugEnabled());
    output += "\n\t orientation: "  + QString::number(logOrientation().isDebugEnabled());
    output += "\n\t movement: "     + QString::number(logMovement().isDebugEnabled());
    output += "\n\t chat: "         + QString::number(logChat().isDebugEnabled());
    output += "\n\t infomsg: "      + QString::number(logInfoMsg().isDebugEnabled());
    output += "\n\t emotes: "       + QString::number(logEmotes().isDebugEnabled());
    output += "\n\t target: "       + QString::number(logTarget().isDebugEnabled());
    output += "\n\t spawn: "        + QString::number(logSpawn().isDebugEnabled());
    output += "\n\t mapevents: "    + QString::number(logMapEvents().isDebugEnabled());
    output += "\n\t slashcommand: " + QString::number(logSlashCommand().isDebugEnabled());
    output += "\n\t description: "  + QString::number(logDescription().isDebugEnabled());
    output += "\n\t friends: "      + QString::number(logFriends().isDebugEnabled());
    output += "\n\t minimap: "      + QString::number(logMiniMap().isDebugEnabled());
    output += "\n\t lfg: "          + QString::number(logLFG().isDebugEnabled());
    output += "\n\t npcs: "         + QString::number(logNPCs().isDebugEnabled());
    output += "\n\t animations: "   + QString::number(logAnimations().isDebugEnabled());
    output += "\n\t powers: "       + QString::number(logPowers().isDebugEnabled());
    output += "\n\t trades: "       + QString::number(logTrades().isDebugEnabled());
    output += "\n\t scenegraph: "   + QString::number(logSceneGraph().isDebugEnabled());

    qDebug().noquote() << output;
}
Ejemplo n.º 3
0
FlushContext::SP
FlushEngine::initNextFlush(const FlushContext::List &lst)
{
    FlushContext::SP ctx;
    for (const FlushContext::SP & it : lst) {
        if (LOG_WOULD_LOG(event)) {
            EventLogger::flushInit(it->getName());
        }
        if (it->initFlush()) {
            ctx = it;
            break;
        }
    }
    if (ctx) {
        logTarget("initiated", *ctx);
    }
    return ctx;
}
Ejemplo n.º 4
0
void toggleLogging(QString &category)
{
    if(category.isEmpty())
        return;

    QLoggingCategory *cat = nullptr;

    if(category.contains("logging",Qt::CaseInsensitive))
        cat = &logLogging();
    else if(category.contains("keybinds",Qt::CaseInsensitive))
        cat = &logKeybinds();
    else if(category.contains("settings",Qt::CaseInsensitive))
        cat = &logSettings();
    else if(category.contains("gui",Qt::CaseInsensitive))
        cat = &logGUI();
    else if(category.contains("teams",Qt::CaseInsensitive))
        cat = &logTeams();
    else if(category.contains("db",Qt::CaseInsensitive))
        cat = &logDB();
    else if(category.contains("input",Qt::CaseInsensitive))
        cat = &logInput();
    else if(category.contains("position",Qt::CaseInsensitive))
        cat = &logPosition();
    else if(category.contains("orientation",Qt::CaseInsensitive))
        cat = &logOrientation();
    else if(category.contains("movement",Qt::CaseInsensitive))
        cat = &logMovement();
    else if(category.contains("chat",Qt::CaseInsensitive))
        cat = &logChat();
    else if(category.contains("infomsg",Qt::CaseInsensitive))
        cat = &logInfoMsg();
    else if(category.contains("emotes",Qt::CaseInsensitive))
        cat = &logEmotes();
    else if(category.contains("target",Qt::CaseInsensitive))
        cat = &logTarget();
    else if(category.contains("spawn",Qt::CaseInsensitive))
        cat = &logSpawn();
    else if(category.contains("mapevents",Qt::CaseInsensitive))
        cat = &logMapEvents();
    else if (category.contains("mapxfers",Qt::CaseInsensitive))
        cat = &logMapXfers();
    else if(category.contains("slashcommand",Qt::CaseInsensitive))
        cat = &logSlashCommand();
    else if(category.contains("description",Qt::CaseInsensitive))
        cat = &logDescription();
    else if(category.contains("friends",Qt::CaseInsensitive))
        cat = &logFriends();
    else if(category.contains("minimap",Qt::CaseInsensitive))
        cat = &logMiniMap();
    else if(category.contains("lfg",Qt::CaseInsensitive))
        cat = &logLFG();
    else if(category.contains("npcs",Qt::CaseInsensitive))
        cat = &logNPCs();
    else if(category.contains("animations",Qt::CaseInsensitive))
        cat = &logAnimations();
    else if(category.contains("powers",Qt::CaseInsensitive))
        cat = &logPowers();
    else if(category.contains("trades",Qt::CaseInsensitive))
        cat = &logTrades();
    else if(category.contains("scripts", Qt::CaseInsensitive))
        cat = &logScripts();
    else if(category.contains("scenegraph",Qt::CaseInsensitive))
        cat = &logSceneGraph();
    else
        return;

    cat->setEnabled(QtDebugMsg, !cat->isDebugEnabled());
    cat->setEnabled(QtInfoMsg, !cat->isInfoEnabled());
    cat->setEnabled(QtWarningMsg, !cat->isWarningEnabled());
    cat->setEnabled(QtCriticalMsg, !cat->isCriticalEnabled());

    dumpLogging();
}