Ejemplo n.º 1
0
bool AppLogModule::Log(Context &ctx, const char *logChannel, const ROAnything &config, eLogLevel iLevel)
{
	StartTrace1(AppLogModule.Log, "LogChannel [" << NotNull(logChannel) << "]" );
	TraceAny(config, "Config: ");
	Server *s = ctx.GetServer();
	if (!s) {
		s = Server::FindServer("Server");
		ctx.SetServer(s);
	}
	AppLogChannel *logger = FindLogger(ctx, logChannel);
	if ( logger ) {
		Trace("logger found");
		return logger->LogAll(ctx, iLevel, config);
	}
	return false;
}
Ejemplo n.º 2
0
bool AppLogModule::Log(Context &ctx, const char *logChannel, const String &strMessage, eLogLevel iLevel)
{
	StartTrace1(AppLogModule.Log, "LogChannel [" << NotNull(logChannel) << "], Severity:" << (long)iLevel );
	Server *s = ctx.GetServer();
	if (!s) {
		s = Server::FindServer("Server");
		ctx.SetServer(s);
	}
	AppLogChannel *logger = FindLogger(ctx, logChannel);
	if ( logger ) {
		Trace("logger found");
		Anything anyMessage(strMessage);
		return logger->LogAll(ctx, iLevel, anyMessage);
	} else {
		Trace("logger:" << logChannel << " not found, message:" << strMessage);
	}
	return false;
}