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

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;

      }

}