< Previous by Date | Date Index | Next by Date > |
< Previous in Thread | Thread Index |
That works. : ) From: Justin Matthews
[mailto:jmatthewsr@xxxxxxxxx] Another option: add another type to log:
OnlyExternalNoHeaders? From: Justin Matthews
[mailto:jmatthewsr@xxxxxxxxx] Ok, thanks. I don’t want the tag information formatted if I
never use it, there is a lot of logging and reducing processing during logging
adds up. The return value doesn’t help here because it is called too
late. How about an additional default param to Log::initialize to disable
default header handling? Any objections or a better way to do this? Thanks, -justin From: Scott Godin
[mailto:slgodin@xxxxxxxxxxxx] 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@xxxxxxxxxxxxxxxxxxxx
[mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Justin
Matthews 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; } } |