Exemple #1
0
void Log::ReloadConfig()
{
    m_logLevel     = ConfigMgr::GetIntDefault("LogLevel", LOGL_NORMAL);
    m_logFileLevel = ConfigMgr::GetIntDefault("LogFileLevel", LOGL_NORMAL);
    m_dbLogLevel   = ConfigMgr::GetIntDefault("DBLogLevel", LOGL_NORMAL);

    _DebugLogMask = DebugLogFilters(ConfigMgr::GetIntDefault("DebugLogMask", LOG_FILTER_NONE));
}
Exemple #2
0
void Log::ReloadConfig()
{
    m_logLevel = GetConfigSettings::GetIntState("LogLevel", LOGL_NORMAL);
    m_logFileLevel = GetConfigSettings::GetIntState("LogFileLevel", LOGL_NORMAL);
    m_dbLogLevel = GetConfigSettings::GetIntState("DBLogLevel", LOGL_NORMAL);

    m_DebugLogMask = DebugLogFilters(GetConfigSettings::GetIntState("DebugLogMask", LOG_FILTER_NONE));
}
Exemple #3
0
static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item **myItems, Item **hisItems)
{
    myTrade->SetInAcceptProcess(true);
    hisTrade->SetInAcceptProcess(true);

    // store items in local list and set 'in-trade' flag
    for(uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
    {
        if(Item* item = myTrade->GetItem(TradeSlots(i)))
        {
            sLog->outDebug(DebugLogFilters(LOG_FILTER_UNITS | LOG_FILTER_PLAYER_ITEMS), "player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
            //Can return NULL
            myItems[i] = item;
            myItems[i]->SetInTrade();
        }

        if(Item* item = hisTrade->GetItem(TradeSlots(i)))
        {
            sLog->outDebug(DebugLogFilters(LOG_FILTER_UNITS | LOG_FILTER_PLAYER_ITEMS), "partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
            hisItems[i] = item;
            hisItems[i]->SetInTrade();
        }
    }
}
Exemple #4
0
void Log::Initialize()
{
    /// Check whether we'll log GM commands/RA events/character outputs/chat stuffs
    m_dbChar = sConfig->GetBoolDefault("LogDB.Char", false);
    m_dbRA = sConfig->GetBoolDefault("LogDB.RA", false);
    m_dbGM = sConfig->GetBoolDefault("LogDB.GM", false);
    m_dbChat = sConfig->GetBoolDefault("LogDB.Chat", false);

    /// Realm must be 0 by default
    SetRealmID(0);

    /// Common log files data
    m_logsDir = sConfig->GetStringDefault("LogsDir", "");
    if(!m_logsDir.empty())
        if((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\'))
            m_logsDir.append("/");

    m_logsTimestamp = "_" + GetTimestampStr();

    /// Open specific log files
    logfile = openLogFile("LogFile", "LogTimestamp", "w");
    InitColors(sConfig->GetStringDefault("LogColors", ""));

    m_gmlog_per_account = sConfig->GetBoolDefault("GmLogPerAccount", false);
    if(!m_gmlog_per_account)
        gmLogfile = openLogFile("GMLogFile", "GmLogTimestamp", "a");
    else
    {
        // GM log settings for per account case
        m_gmlog_filename_format = sConfig->GetStringDefault("GMLogFile", "");
        if(!m_gmlog_filename_format.empty())
        {
            bool m_gmlog_timestamp = sConfig->GetBoolDefault("GmLogTimestamp", false);

            size_t dot_pos = m_gmlog_filename_format.find_last_of(".");
            if(dot_pos!=m_gmlog_filename_format.npos)
            {
                if(m_gmlog_timestamp)
                    m_gmlog_filename_format.insert(dot_pos, m_logsTimestamp);

                m_gmlog_filename_format.insert(dot_pos, "_#%u");
            }
            else
            {
                m_gmlog_filename_format += "_#%u";

                if(m_gmlog_timestamp)
                    m_gmlog_filename_format += m_logsTimestamp;
            }

            m_gmlog_filename_format = m_logsDir + m_gmlog_filename_format;
        }
    }

    charLogfile     = openLogFile("CharLogFile", "CharLogTimestamp", "a");
    dberLogfile     = openLogFile("DBErrorLogFile", NULL, "a");
    raLogfile       = openLogFile("RASOAP", NULL, "a");
    chatLogfile     = openLogFile("ChatLogFile", "ChatLogTimestamp", "a");
    arenaLogFile    = openLogFile("ArenaLogFile", NULL, "a");
    sqlLogFile      = openLogFile("SQLDriverLogFile", NULL, "a");
    sqlDevLogFile   = openLogFile("SQLDeveloperLogFile", NULL, "a");
    wardenLogFile   = openLogFile("WardenLogFile", NULL, "a");

    // Main log file settings
    m_logLevel     = sConfig->GetIntDefault("LogLevel", LOGL_NORMAL);
    m_logFileLevel = sConfig->GetIntDefault("LogFileLevel", LOGL_NORMAL);
    m_dbLogLevel   = sConfig->GetIntDefault("DBLogLevel", LOGL_NORMAL);
    m_sqlDriverQueryLogging  = sConfig->GetBoolDefault("SQLDriverQueryLogging", false);

    m_DebugLogMask = DebugLogFilters(sConfig->GetIntDefault("DebugLogMask", LOG_FILTER_NONE));

    // Char log settings
    m_charLog_Dump = sConfig->GetBoolDefault("CharLogDump", false);
    m_charLog_Dump_Separate = sConfig->GetBoolDefault("CharLogDump.Separate", false);
    if(m_charLog_Dump_Separate)
    {
        m_dumpsDir = sConfig->GetStringDefault("CharLogDump.SeparateDir", "");
        if(!m_dumpsDir.empty())
            if((m_dumpsDir.at(m_dumpsDir.length() - 1) != '/') && (m_dumpsDir.at(m_dumpsDir.length() - 1) != '\\'))
                m_dumpsDir.append("/");
    }
}