void StringFormat(std::string& output, const char* format, ...) { va_list args; va_start(args, format); vStringFormat(output,format,args); va_end(args); }
void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...) { bool log_to_console = true; if (log_settings[log_category].log_to_console < debug_level) { log_to_console = false; } bool log_to_file = true; if (log_settings[log_category].log_to_file < debug_level) { log_to_file = false; } bool log_to_gmsay = true; if (log_settings[log_category].log_to_gmsay < debug_level) { log_to_gmsay = false; } const bool nothing_to_log = !log_to_console && !log_to_file && !log_to_gmsay; if (nothing_to_log) return; va_list args; va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, output_message); if (log_to_console) EQEmuLogSys::ProcessConsoleMessage(debug_level, log_category, output_debug_message); if (log_to_gmsay) EQEmuLogSys::ProcessGMSay(debug_level, log_category, output_debug_message); if (log_to_file) EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_debug_message); }
const std::string StringFormat(const char* format, ...) { va_list args; va_start(args, format); std::string output = vStringFormat(format,args); va_end(args); return output; }