Ejemplo n.º 1
0
void DA::Log::Print(const char* File, const char* Function, int LineNumber, const char* Category, Verbosity::Type VerbosityLevel, const char* Format, ...)
{
	if (DoesLogCategoryExist(Category) == false)
	{
		// If the user hasn't explicitly created a category, silently create one for them.
		DeclareLogCategory(Category, OutputMethod::All, DetailLevel::High);
	}
	
	const LogCategory lg = mLogCategories[Category];
	va_list ap;
	va_start(ap, Format);

	switch (lg.mOutputMethod)
	{
	case OutputMethod::ConsoleWindow:
		PrintToConsoleWindow(File, Function, LineNumber, Category, VerbosityLevel, lg.mDetailLevel, Format, ap);
		break;
	case OutputMethod::OutputWindow:
		PrintToOutputWindow(File, Function, LineNumber, Category, VerbosityLevel, lg.mDetailLevel, Format, ap);
		break;
	case OutputMethod::TextFile:
		PrintToTextFile(File, Function, LineNumber, Category, VerbosityLevel, lg.mDetailLevel, Format, ap);
		break;
	case OutputMethod::All:
		// Intended fallthrough.
	default:
		PrintToConsoleWindow(File, Function, LineNumber, Category, VerbosityLevel, lg.mDetailLevel, Format, ap);
		PrintToOutputWindow(File, Function, LineNumber, Category, VerbosityLevel, lg.mDetailLevel, Format, ap);
		PrintToTextFile(File, Function, LineNumber, Category, VerbosityLevel, lg.mDetailLevel, Format, ap);
		break;
	}

	va_end(ap);

	// After we're done logging information, ensure fatal errors are caught.
	if (VerbosityLevel == Verbosity::Fatal)
	{
		HandleFatalError();
	}
}
Ejemplo n.º 2
0
void
IProtocol::FatalError(const char* const aErrorMsg) const
{
  HandleFatalError(ProtocolName(), aErrorMsg);
}