Loading...   


void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...)
{
	const bool logToConsole = log_settings[log_category].log_to_console > 0;
	const bool logToFile = log_settings[log_category].log_to_file > 0;
	const bool logToGMSay = log_settings[log_category].log_to_gmsay > 0;
	const bool skip = !logToConsole  && !logToFile && !logToGMSay;
	if (skip) return;

	try {
		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);
	}
	catch (..) {
		// Now you fucked up!.
	}

	if (logToConsole) EQEmuLogSys::ProcessConsoleMessage(debug_level, log_category, output_debug_message);
	if (logToGMSay) EQEmuLogSys::ProcessGMSay(debug_level, log_category, output_debug_message);
	if (logToFile) EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_message);
}

Raw Paste Data