Exemplo n.º 1
0
void Log::log(Level level, const char* objectName, size_t objectNameSize, const char* message, ...) {
	va_list args;

	if(!wouldLog(level))
		return;

	va_start(args, message);
	logv(level, objectName, objectNameSize, message, args);
	va_end(args);
}
Exemplo n.º 2
0
void Log::logv(Level level, Object* object, const char* message, va_list args) {
	size_t nameSize;
	const char* name;

	if(!wouldLog(level))
		return;

	name = object->getObjectName(&nameSize);
	logv(level, name, nameSize, message, args);
}
Exemplo n.º 3
0
void Logger::put(
    LogFileType logFileType,
    const String& systemId,
    Uint32 logLevel,
    const String& formatString)
{
    if (wouldLog(logLevel))
    {
        Logger::_putInternal(logFileType, systemId, 0, logLevel, formatString);
    }
}
Exemplo n.º 4
0
void Logger::trace(
    LogFileType logFileType,
    const String& systemId,
    const Uint32 logComponent,
    const String& message)
{
    if (wouldLog(Logger::TRACE))
    {
        Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
            message);
    }
}
Exemplo n.º 5
0
void Logger::put(
    LogFileType logFileType,
    const String& systemId,
    Uint32 logLevel,
    const String& formatString,
    const Formatter::Arg& arg0)
{
    if (wouldLog(logLevel))
    {
        Logger::_putInternal(logFileType, systemId, 0, logLevel,
            Formatter::format(formatString, arg0));
    }
}
Exemplo n.º 6
0
void Logger::put_l(
    LogFileType logFileType,
    const String& systemId,
    Uint32 logLevel,
    const MessageLoaderParms& msgParms)
{
    if (wouldLog(logLevel))
    {
        MessageLoaderParms parms = msgParms;
        parms.useProcessLocale = true;
        Logger::_putInternal(logFileType, systemId, 0, logLevel,
            MessageLoader::getMessage(parms));
    }
}
Exemplo n.º 7
0
void Log::logv(Level level, const char* objectName, size_t objectNameSize, const char* message, va_list args) {
	if(!wouldLog(level) || this->messageQueueFull)
		return;

	Message* msg = new Message;
	msg->time_ms = Utils::getTimeInMsec();
	msg->level = level;
	msg->writeToConsole = level <= consoleMaxLevel;
	msg->writeToFile = level <= fileMaxLevel;
	msg->objectName = std::string(objectName, objectName + objectNameSize);
	Utils::stringFormatv(msg->message, message, args);

	uv_mutex_lock(&this->messageListMutex);
	if((int) this->messageQueue.size() < maxQueueSize.get())
		this->messageQueue.push_back(msg);
	else
		this->messageQueueFull = true;
	if(this->messageQueue.size() > maxQueueSizeReached)
		maxQueueSizeReached = this->messageQueue.size();
	uv_cond_signal(&this->messageListCond);
	uv_mutex_unlock(&this->messageListMutex);
}
Exemplo n.º 8
0
void Logger::put(
    LogFileType logFileType,
    const String& systemId,
    Uint32 logLevel,
    const String& formatString,
    const Formatter::Arg& arg0,
    const Formatter::Arg& arg1,
    const Formatter::Arg& arg2,
    const Formatter::Arg& arg3,
    const Formatter::Arg& arg4,
    const Formatter::Arg& arg5,
    const Formatter::Arg& arg6,
    const Formatter::Arg& arg7,
    const Formatter::Arg& arg8,
    const Formatter::Arg& arg9)
{
    if (wouldLog(logLevel))
    {
        Logger::_putInternal(logFileType, systemId, 0, logLevel,
            Formatter::format(formatString, arg0, arg1, arg2, arg3,
                arg4, arg5, arg6, arg7, arg8, arg9));
    }
}