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

[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;

      }

}