[reSIProcate] log entry creation for external only
Scott Godin
slgodin at icescape.com
Mon Dec 4 14:58:06 CST 2006
Even if you are using external logging only - you still might want the
tags - they are passed to the external logger:
class ExternalLogger
{
public:
virtual ~ExternalLogger()=0;
/** return true to also do default logging, false to supress
default logging. */
virtual bool operator()(Log::Level level,
const Subsystem& subsystem,
const Data& appName,
const char* file,
int line,
const Data& message,
const Data& messageWithHeaders) = 0;
};
Scott
BTW: Log::OnlyExternal is a redundant setting. You can return true or
false from the external logger fn, if you want logging to continue or
not using resip handling.
From: resiprocate-devel-bounces at list.resiprocate.org
[mailto:resiprocate-devel-bounces at list.resiprocate.org] On Behalf Of
Justin Matthews
Sent: Monday, December 04, 2006 3:18 PM
To: resiprocate-devel at list.resiprocate.org
Subject: [reSIProcate] log entry creation for external only
For apps that use external logging only, can Log::Guard::Guard() disable
outputting the tags to the log stream since it will never be used
anyway?
Log::Guard::Guard(resip::Log::Level level,
const resip::Subsystem& subsystem,
const char* file,
int line) :
mLevel(level),
mSubsystem(subsystem),
mFile(file),
mLine(line),
mData(Data::Borrow, mBuffer, sizeof(mBuffer)),
mStream(mData.clear())
{
/* mod, not needed by external logger*/
if (resip::Log::_type != resip::Log::OnlyExternal)
{
Log::tags(mLevel, mSubsystem, mFile, mLine, mStream);
mStream << resip::Log::delim;
mStream.flush();
mHeaderLength = mData.size();
}
else
{
mHeaderLength = 0;
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20061204/f3215c45/attachment.htm>
More information about the resiprocate-devel
mailing list