< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] log entry creation for external only


That works.  : )

 

From: Justin Matthews [mailto:jmatthewsr@xxxxxxxxx]
Sent: Monday, December 04, 2006 4:10 PM
To: Scott Godin; resiprocate-devel@xxxxxxxxxxxxxxxxxxxx
Subject: RE: [reSIProcate] log entry creation for external only

 

Another option: add another type to log:  OnlyExternalNoHeaders?

 


From: Justin Matthews [mailto:jmatthewsr@xxxxxxxxx]
Sent: Monday, December 04, 2006 4:08 PM
To: 'Scott Godin'; 'resiprocate-devel@xxxxxxxxxxxxxxxxxxxx'
Subject: RE: [reSIProcate] log entry creation for external only

 

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]
Sent: Monday, December 04, 2006 3:58 PM
To: Justin Matthews; resiprocate-devel@xxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxx [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Justin Matthews
Sent: Monday, December 04, 2006 3:18 PM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxxx
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;

      }

}