Skip to content

Commit

Permalink
libdeng2|Log: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 5, 2012
1 parent 16f2705 commit 2052b16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
16 changes: 8 additions & 8 deletions doomsday/libdeng2/include/de/core/log.h
Expand Up @@ -444,20 +444,20 @@ class DENG2_PUBLIC Log

/**
* Creates a new log entry with the default (MESSAGE) level.
* Append the parameters of the entry using the << operator.
*
* @param format Format template of the entry.
* @param format Format template of the entry.
* @param arguments List of arguments. The entry is given ownership of
* each Arg instance.
*/
LogEntry &enter(String const &format);
LogEntry &enter(String const &format, LogEntry::Args arguments = LogEntry::Args());

/**
* Creates a new log entry with the specified level.
* Append the parameters of the entry using the << operator.
* Creates a new log entry with the specified log entry level.
*
* @param level Level of the entry.
* @param format Format template of the entry.
* @param level Level of the entry.
* @param format Format template of the entry.
* @param arguments List of arguments. The entry is given ownership of
* each Arg instance.
* each Arg instance.
*/
LogEntry &enter(LogEntry::Level level, String const &format, LogEntry::Args arguments = LogEntry::Args());

Expand Down
10 changes: 7 additions & 3 deletions doomsday/libdeng2/src/core/log.cpp
Expand Up @@ -309,9 +309,9 @@ void Log::endSection(char const *DENG2_DEBUG_ONLY(name))
_sectionStack.takeLast();
}

LogEntry &Log::enter(String const &format)
LogEntry &Log::enter(String const &format, LogEntry::Args arguments)
{
return enter(LogEntry::MESSAGE, format, LogEntry::Args());
return enter(LogEntry::MESSAGE, format, arguments);
}

LogEntry &Log::enter(LogEntry::Level level, String const &format, LogEntry::Args arguments)
Expand Down Expand Up @@ -387,9 +387,13 @@ void Log::disposeThreadLog()
logs.unlock();
}

LogEntryStager::LogEntryStager(LogEntry::Level level, const String &format) : _level(level), _format(format)
LogEntryStager::LogEntryStager(LogEntry::Level level, String const &format) : _level(level)
{
_disabled = !LogBuffer::appBuffer().isEnabled(level);
if(!_disabled)
{
_format = format;
}
}

} // namespace de

0 comments on commit 2052b16

Please sign in to comment.