[reSIProcate] log entry creation for external only
    Justin Matthews 
    jmatthewsr at gmail.com
       
    Mon Dec  4 15:07:43 CST 2006
    
    
  
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 at icescape.com] 
Sent: Monday, December 04, 2006 3:58 PM
To: Justin Matthews; resiprocate-devel at list.resiprocate.org
Subject: RE: [reSIProcate] log entry creation for external only
 
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/7238f2b2/attachment.htm>
    
    
More information about the resiprocate-devel
mailing list