|
reSIProcate/rutil
9694
|
Implementation for logging macros. More...
#include <Log.hxx>

Public Member Functions | |
| Guard (Level level, const Subsystem &system, const char *file, int line) | |
| Remember the logging values and be a a stream to receive the log contents. | |
| ~Guard () | |
| Commit logging. | |
| EncodeStream & | asStream () |
| operator EncodeStream & () | |
Private Member Functions | |
| Guard & | operator= (const Guard &) |
Private Attributes | |
| resip::Log::Level | mLevel |
| const resip::Subsystem & | mSubsystem |
| resip::Data::size_type | mHeaderLength |
| const char * | mFile |
| int | mLine |
| char | mBuffer [128] |
| Data | mData |
| oDataStream | mStream |
Implementation for logging macros.
Log::Guard(Log::Info, Subsystem::TEST, __FILE__, __LINE__) << ... ;
Remember the logging values and be a a stream to receive the log contents.
Definition at line 705 of file Log.cxx.
References resip::Log::delim, resip::Log::getLoggerData(), mData, mFile, mHeaderLength, mLevel, mLine, mStream, mSubsystem, resip::Log::OnlyExternalNoHeaders, resip::Data::size(), and resip::Log::tags().
: mLevel(level), mSubsystem(subsystem), mFile(file), mLine(line), mData(Data::Borrow, mBuffer, sizeof(mBuffer)), mStream(mData.clear()) { if (resip::Log::getLoggerData().mType != resip::Log::OnlyExternalNoHeaders) { Log::tags(mLevel, mSubsystem, mFile, mLine, mStream); mStream << resip::Log::delim; mStream.flush(); mHeaderLength = mData.size(); } else { mHeaderLength = 0; } }

| Log::Guard::~Guard | ( | ) |
Commit logging.
Definition at line 731 of file Log.cxx.
References resip::Log::_mutex, resip::Log::getAppName(), resip::Log::getExternal(), resip::Log::getLoggerData(), resip::Log::Instance(), resip::Log::ThreadData::mType, resip::Log::OnlyExternal, resip::Log::OnlyExternalNoHeaders, resip::Log::OutputToWin32DebugWindow(), resip::Data::Share, and resip::Log::VSDebugWindow.
{
mStream.flush();
if (resip::Log::getExternal())
{
const resip::Data rest(resip::Data::Share,
mData.data() + mHeaderLength,
(int)mData.size() - mHeaderLength);
if (!(*resip::Log::getExternal())(mLevel,
mSubsystem,
resip::Log::getAppName(),
mFile,
mLine,
rest,
mData))
{
return;
}
}
Type logType = resip::Log::getLoggerData().mType;
if(logType == resip::Log::OnlyExternal ||
logType == resip::Log::OnlyExternalNoHeaders)
{
return;
}
resip::Lock lock(resip::Log::_mutex);
// !dlb! implement VSDebugWindow as an external logger
if (logType == resip::Log::VSDebugWindow)
{
mData += "\r\n";
OutputToWin32DebugWindow(mData);
}
else
{
// endl is magic in syslog -- so put it here
Instance((int)mData.size()+2) << mData << std::endl;
}
}

| EncodeStream& resip::Log::Guard::asStream | ( | ) | [inline] |
| resip::Log::Guard::operator EncodeStream & | ( | ) | [inline] |
char resip::Log::Guard::mBuffer[128] [private] |
Data resip::Log::Guard::mData [private] |
const char* resip::Log::Guard::mFile [private] |
resip::Log::Level resip::Log::Guard::mLevel [private] |
int resip::Log::Guard::mLine [private] |
oDataStream resip::Log::Guard::mStream [private] |
Definition at line 126 of file Log.hxx.
Referenced by asStream(), Guard(), and operator EncodeStream &().
const resip::Subsystem& resip::Log::Guard::mSubsystem [private] |
1.7.5.1