Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opentxs::OTLogStream Class Reference

#include <OTLog.hpp>

Inheritance diagram for opentxs::OTLogStream:
Collaboration diagram for opentxs::OTLogStream:

Public Member Functions

 OTLogStream (int _logLevel)
 
 ~OTLogStream ()
 
virtual int overflow (int c)
 

Detailed Description

Definition at line 181 of file OTLog.hpp.

Constructor & Destructor Documentation

opentxs::OTLogStream::OTLogStream ( int  _logLevel)

Definition at line 264 of file OTLog.cpp.

265  : std::ostream(this)
266  , logLevel(_logLevel)
267  , next(0)
268  , pBuffer(new char[1024])
269 {
270 }
opentxs::OTLogStream::~OTLogStream ( )

Definition at line 272 of file OTLog.cpp.

273 {
274  delete[] pBuffer;
275  pBuffer = nullptr;
276 }

Member Function Documentation

int opentxs::OTLogStream::overflow ( int  c)
virtual

Definition at line 278 of file OTLog.cpp.

279 {
280  pBuffer[next++] = c;
281  if (c != '\n' && next < 1000) {
282  return 0;
283  }
284 
285  pBuffer[next++] = '\0';
286  next = 0;
287 
288  if (logLevel < 0) {
289  OTLog::Error(pBuffer);
290  return 0;
291  }
292 
293  OTLog::Output(logLevel, pBuffer);
294  return 0;
295 }
static EXPORT void Output(int32_t nVerbosity, const char *szOutput)
Definition: OTLog.cpp:710
static EXPORT void Error(const char *szError)
Definition: OTLog.cpp:831

The documentation for this class was generated from the following files: