PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
PLog Class Reference

Phoenix Logger. More...

#include <PLog.h>

+ Collaboration diagram for PLog:

Public Types

enum  Level {
  DEBUG = 1 , INFO = 2 , WARNING = 3 , ERROR = 4 ,
  CRITICAL = 5 , ALWAYS = 6
}
 Log level to be used in the logger. More...
 
enum  Mode {
  FILE_ONLY , STRING_ONLY , STDOUT_ONLY , FILE_CAPTURE_STDOUT_STDERR ,
  DISABLE
}
 Mode to be used on the logger. More...
 

Public Member Functions

void appendLog (std::stringstream &str)
 Append the log (STRING_ONLY mode) into an other log. More...
 
void clear ()
 Clear the children of the current PLog. More...
 
void close ()
 Close the current PLog and its children. More...
 
const PPathgetFileName () const
 Get the filename of the current log. More...
 
std::ostream & getLog (PLog::Level logLevel=PLog::INFO)
 Write log into the PLog. More...
 
PLoggetLog (size_t threadIndex)
 Get the PLog at given index. More...
 
std::ostream & getLogAlways ()
 Write always message into the PLog. More...
 
std::ostream & getLogCritical ()
 Write critical message into the PLog. More...
 
std::ostream & getLogDebug ()
 Write debug message into the PLog. More...
 
std::ostream & getLogError ()
 Write error message into the PLog. More...
 
std::ofstream & getLogFile ()
 Get the current log file. More...
 
std::ostream & getLogInfo ()
 Write info message into the PLog. More...
 
PLog::Level getLogLevel () const
 Get the log level of the current PLog. More...
 
std::stringstream & getLogString ()
 Get the log string. More...
 
std::ostream & getLogWarning ()
 Write warning message into the PLog. More...
 
PLog::Mode getMode () const
 Get the mode of the current PLog. More...
 
size_t getThreadIndex () const
 Get the thread index of the current PLog. More...
 
bool isOpen () const
 Say if the current PLog is opened or not. More...
 
bool open ()
 Open the current PLog and its children. More...
 
 PLog ()
 Default constructor of PLog. More...
 
void resize (size_t nbThread)
 Resize the number of cihldren log file. More...
 
void setFileName (const PPath &fileName)
 Set the output filename of the current PLog. More...
 
void setLogLevel (PLog::Level logLevel)
 Set the log level of the current PLog. More...
 
void setMode (PLog::Mode mode)
 Set the mode of the current PLog. More...
 
void setThreadIndex (size_t threadIndex)
 Set the thread index of the current PLog. More...
 
virtual ~PLog ()
 Destructor of PLog. More...
 

Private Member Functions

void allocateStream (std::streambuf *buffer)
 Allocate the stream. More...
 
void initialisationPLog ()
 Initialisation function of the class PLog. More...
 
bool streamOpen ()
 Open the streams. More...
 

Private Attributes

PPath p_fileName
 Output filename of the current PLog. More...
 
bool p_isOpen
 True of the log is opened. More...
 
std::ofstream p_logFile
 Current log file to be used. More...
 
PLog::Level p_logLevel
 Current log level of the PLog (all log greater or equal to the p_logLevel will be logged) More...
 
std::stringstream p_logString
 Log string. More...
 
PLog::Mode p_mode
 Mode of the logger. More...
 
std::ostream * p_nullStream
 Stream used to disable log output. More...
 
std::streambuf * p_oldStdCerrBuffer
 Old std::cerr buffer. More...
 
std::streambuf * p_oldStdCoutBuffer
 Old std::cout buffer. More...
 
std::ostream * p_stream
 Current stream to be used to log things. More...
 
size_t p_threadIndex
 Index of the current thread. More...
 
std::vector< PLog * > p_vecLog
 Vector of sur log file to be used (mainly for multithreaded programs) More...
 

Detailed Description

Phoenix Logger.

Definition at line 21 of file PLog.h.

Member Enumeration Documentation

◆ Level

Log level to be used in the logger.

Enumerator
DEBUG 
INFO 
WARNING 
ERROR 
CRITICAL 
ALWAYS 

Definition at line 32 of file PLog.h.

32  {
33  DEBUG = 1,
34  INFO = 2,
35  WARNING = 3,
36  ERROR = 4,
37  CRITICAL = 5,
38  ALWAYS = 6
39  };
@ CRITICAL
Definition: PLog.h:37
@ INFO
Definition: PLog.h:34
@ DEBUG
Definition: PLog.h:33
@ ERROR
Definition: PLog.h:36
@ ALWAYS
Definition: PLog.h:38
@ WARNING
Definition: PLog.h:35

◆ Mode

enum PLog::Mode

Mode to be used on the logger.

Enumerator
FILE_ONLY 
STRING_ONLY 
STDOUT_ONLY 
FILE_CAPTURE_STDOUT_STDERR 
DISABLE 

Definition at line 24 of file PLog.h.

24  {
25  FILE_ONLY,
29  DISABLE
30  };
@ STRING_ONLY
Definition: PLog.h:26
@ FILE_CAPTURE_STDOUT_STDERR
Definition: PLog.h:28
@ FILE_ONLY
Definition: PLog.h:25
@ DISABLE
Definition: PLog.h:29
@ STDOUT_ONLY
Definition: PLog.h:27

Constructor & Destructor Documentation

◆ PLog()

PLog::PLog ( )

Default constructor of PLog.

Definition at line 46 of file PLog.cpp.

46  {
48 }
void initialisationPLog()
Initialisation function of the class PLog.
Definition: PLog.cpp:285

References initialisationPLog().

Referenced by resize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~PLog()

PLog::~PLog ( )
virtual

Destructor of PLog.

Definition at line 51 of file PLog.cpp.

51  {
52  close();
53  clear();
54  delete p_nullStream;
55 }
void close()
Close the current PLog and its children.
Definition: PLog.cpp:123
std::ostream * p_nullStream
Stream used to disable log output.
Definition: PLog.h:88
void clear()
Clear the children of the current PLog.
Definition: PLog.cpp:153

References clear(), close(), and p_nullStream.

+ Here is the call graph for this function:

Member Function Documentation

◆ allocateStream()

void PLog::allocateStream ( std::streambuf *  buffer)
private

Allocate the stream.

Parameters
buffer: buffer to be used

Definition at line 299 of file PLog.cpp.

299  {
300  if(p_stream != NULL){
301  delete p_stream;
302  }
303  p_stream = new std::ostream(buffer);
304 }
std::ostream * p_stream
Current stream to be used to log things.
Definition: PLog.h:86

References p_stream.

Referenced by streamOpen().

+ Here is the caller graph for this function:

◆ appendLog()

void PLog::appendLog ( std::stringstream &  str)

Append the log (STRING_ONLY mode) into an other log.

Parameters
str: log string to be appended

Definition at line 168 of file PLog.cpp.

168  {
169  getLog(PLog::ALWAYS) << "Append log" << std::endl << str.str();
170 }
PLog & getLog(size_t threadIndex)
Get the PLog at given index.
Definition: PLog.cpp:175

References ALWAYS, and getLog().

Referenced by testStringLogAppend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void PLog::clear ( )

Clear the children of the current PLog.

Definition at line 153 of file PLog.cpp.

153  {
154  if(p_vecLog.size() != 0lu){
155  for(std::vector<PLog*>::iterator it(p_vecLog.begin()); it != p_vecLog.end(); ++it){
156  PLog* log = *it;
157  if(log != NULL){
158  delete log;
159  }
160  }
161  p_vecLog.clear();
162  }
163 }
Phoenix Logger.
Definition: PLog.h:21
std::vector< PLog * > p_vecLog
Vector of sur log file to be used (mainly for multithreaded programs)
Definition: PLog.h:94

References p_vecLog.

Referenced by resize(), and ~PLog().

+ Here is the caller graph for this function:

◆ close()

void PLog::close ( )

Close the current PLog and its children.

Definition at line 123 of file PLog.cpp.

123  {
124  if(p_stream != NULL && p_isOpen){
125  getLogAlways() << "Close Log File at " << phoenix_getDate() << std::endl;
126  }
127  if(p_logFile.is_open()){
128  p_logFile.close();
129  }
130 // if(p_mode == PLog::STRING_ONLY){
131 // p_logString.close();
132 // }
133  if(p_oldStdCerrBuffer != NULL){
134  std::cerr.rdbuf(p_oldStdCerrBuffer); //Let's get back to previous std::cerr buffer
135  }
136  if(p_oldStdCoutBuffer != NULL){
137  std::cout.rdbuf(p_oldStdCoutBuffer); //Let's get back to previous std::cout buffer
138  }
139  if(p_stream != NULL){
140  delete p_stream;
141  p_stream = NULL;
142  }
143  p_isOpen = false;
144  for(std::vector<PLog*>::iterator it(p_vecLog.begin()); it != p_vecLog.end(); ++it){
145  PLog* log = *it;
146  if(log != NULL){
147  log->close();
148  }
149  }
150 }
std::ostream & getLogAlways()
Write always message into the PLog.
Definition: PLog.cpp:244
std::ofstream p_logFile
Current log file to be used.
Definition: PLog.h:82
std::streambuf * p_oldStdCoutBuffer
Old std::cout buffer.
Definition: PLog.h:92
bool p_isOpen
True of the log is opened.
Definition: PLog.h:96
std::streambuf * p_oldStdCerrBuffer
Old std::cerr buffer.
Definition: PLog.h:90
PString phoenix_getDate()
Get the current date.

References close(), getLogAlways(), p_isOpen, p_logFile, p_oldStdCerrBuffer, p_oldStdCoutBuffer, p_stream, p_vecLog, and phoenix_getDate().

Referenced by close(), testLogCoutDedirectInFile(), testLogDisable(), testLogStdoutOnly(), testStringLogAppend(), and ~PLog().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileName()

const PPath & PLog::getFileName ( ) const

Get the filename of the current log.

Returns
filename of the current log

Definition at line 252 of file PLog.cpp.

252  {
253  return p_fileName;
254 }
PPath p_fileName
Output filename of the current PLog.
Definition: PLog.h:80

References p_fileName.

Referenced by testStringPLog(), and testStringPLogLevel().

+ Here is the caller graph for this function:

◆ getLog() [1/2]

std::ostream & PLog::getLog ( PLog::Level  logLevel = PLog::INFO)

Write log into the PLog.

Parameters
logLevel: log level of the current line
Returns
ofstream to be written

Definition at line 197 of file PLog.cpp.

197  {
198  if(logLevel >= p_logLevel){
199  *p_stream << "[" << phoenix_getTime() << "][" << phoenix_getDateCompact() << "][" << p_threadIndex << "]["<<phoenix_logLevelToStr(logLevel)<<"] : ";
200  return *p_stream;
201  }else{
202  return *p_nullStream;
203  }
204 }
PString phoenix_logLevelToStr(PLog::Level logLevel)
Convert the log level into a PString.
Definition: PLog.cpp:15
PLog::Level p_logLevel
Current log level of the PLog (all log greater or equal to the p_logLevel will be logged)
Definition: PLog.h:78
size_t p_threadIndex
Index of the current thread.
Definition: PLog.h:98
PString phoenix_getDateCompact()
Get the current date.
time_t phoenix_getTime()
Get the current time of the program.

References p_logLevel, p_nullStream, p_stream, p_threadIndex, phoenix_getDateCompact(), phoenix_getTime(), and phoenix_logLevelToStr().

+ Here is the call graph for this function:

◆ getLog() [2/2]

PLog & PLog::getLog ( size_t  threadIndex)

Get the PLog at given index.

Returns
PLog at Index

Definition at line 175 of file PLog.cpp.

175  {
176  return *(p_vecLog[threadIndex]);
177 }

References p_vecLog.

Referenced by appendLog(), getLogAlways(), getLogCritical(), getLogDebug(), getLogError(), getLogInfo(), getLogWarning(), testLogCoutDedirectInFile(), testLogDisable(), testLogStdoutOnly(), testStringLogAppend(), testStringMultiPLog(), testStringPLog(), and testStringPLogLevel().

+ Here is the caller graph for this function:

◆ getLogAlways()

std::ostream & PLog::getLogAlways ( )

Write always message into the PLog.

Returns
ofstream to be written

Definition at line 244 of file PLog.cpp.

244  {
245  return getLog(PLog::ALWAYS);
246 }

References ALWAYS, and getLog().

Referenced by close(), and open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogCritical()

std::ostream & PLog::getLogCritical ( )

Write critical message into the PLog.

Returns
ofstream to be written

Definition at line 237 of file PLog.cpp.

237  {
238  return getLog(PLog::CRITICAL);
239 }

References CRITICAL, and getLog().

Referenced by testStringLogAppend(), and testStringPLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogDebug()

std::ostream & PLog::getLogDebug ( )

Write debug message into the PLog.

Returns
ofstream to be written

Definition at line 209 of file PLog.cpp.

209  {
210  return getLog(PLog::DEBUG);
211 }

References DEBUG, and getLog().

Referenced by testStringLogAppend(), and testStringPLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogError()

std::ostream & PLog::getLogError ( )

Write error message into the PLog.

Returns
ofstream to be written

Definition at line 230 of file PLog.cpp.

230  {
231  return getLog(PLog::ERROR);
232 }

References ERROR, and getLog().

Referenced by testStringLogAppend(), and testStringPLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogFile()

std::ofstream & PLog::getLogFile ( )

Get the current log file.

Returns
current log file

Definition at line 182 of file PLog.cpp.

182  {
183  return p_logFile;
184 }

References p_logFile.

◆ getLogInfo()

std::ostream & PLog::getLogInfo ( )

Write info message into the PLog.

Returns
ofstream to be written

Definition at line 216 of file PLog.cpp.

216  {
217  return getLog(PLog::INFO);
218 }

References getLog(), and INFO.

Referenced by testStringLogAppend(), and testStringPLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogLevel()

PLog::Level PLog::getLogLevel ( ) const

Get the log level of the current PLog.

Returns
log level of the current PLog

Definition at line 266 of file PLog.cpp.

266  {
267  return p_logLevel;
268 }

References p_logLevel.

Referenced by open().

+ Here is the caller graph for this function:

◆ getLogString()

std::stringstream & PLog::getLogString ( )

Get the log string.

Returns
log string

Definition at line 189 of file PLog.cpp.

189  {
190  return p_logString;
191 }
std::stringstream p_logString
Log string.
Definition: PLog.h:84

References p_logString.

Referenced by testStringLogAppend().

+ Here is the caller graph for this function:

◆ getLogWarning()

std::ostream & PLog::getLogWarning ( )

Write warning message into the PLog.

Returns
ofstream to be written

Definition at line 223 of file PLog.cpp.

223  {
224  return getLog(PLog::WARNING);
225 }

References getLog(), and WARNING.

Referenced by testStringLogAppend(), and testStringPLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMode()

PLog::Mode PLog::getMode ( ) const

Get the mode of the current PLog.

Returns
mode of the current PLog

Definition at line 259 of file PLog.cpp.

259  {
260  return p_mode;
261 }
PLog::Mode p_mode
Mode of the logger.
Definition: PLog.h:76

References p_mode.

◆ getThreadIndex()

size_t PLog::getThreadIndex ( ) const

Get the thread index of the current PLog.

Returns
thread index of the current PLog

Definition at line 273 of file PLog.cpp.

273  {
274  return p_threadIndex;
275 }

References p_threadIndex.

Referenced by testStringPLog().

+ Here is the caller graph for this function:

◆ initialisationPLog()

void PLog::initialisationPLog ( )
private

Initialisation function of the class PLog.

Definition at line 285 of file PLog.cpp.

285  {
288  p_oldStdCerrBuffer = NULL;
289  p_oldStdCoutBuffer = NULL;
290  p_isOpen = false;
291  p_stream = NULL;
292  p_nullStream = new std::ostream(NULL);
293  p_threadIndex = 0lu;
294 }

References FILE_ONLY, INFO, p_isOpen, p_logLevel, p_mode, p_nullStream, p_oldStdCerrBuffer, p_oldStdCoutBuffer, p_stream, and p_threadIndex.

Referenced by PLog().

+ Here is the caller graph for this function:

◆ isOpen()

bool PLog::isOpen ( ) const

Say if the current PLog is opened or not.

Returns
true if the current PLog is opened, false otherwise

Definition at line 280 of file PLog.cpp.

280  {
281  return p_isOpen;
282 }

References p_isOpen.

Referenced by testStringPLog().

+ Here is the caller graph for this function:

◆ open()

bool PLog::open ( )

Open the current PLog and its children.

Returns
true on success, false otherwise

Definition at line 104 of file PLog.cpp.

104  {
105  bool b(true);
106  b &= streamOpen();
107  p_isOpen = b;
108  if(b){
109  getLogAlways() << "[UTC][Date][ThreadIndex][LogLevel] : log message" << std::endl;
110  getLogAlways() << "Start logging at " << phoenix_getDate() << std::endl;
111  getLogAlways() << "Current logging level '"<<phoenix_logLevelToStr(getLogLevel())<<"'" << std::endl;
112  }
113  for(std::vector<PLog*>::iterator it(p_vecLog.begin()); it != p_vecLog.end(); ++it){
114  PLog* log = *it;
115  if(log != NULL){
116  b &= log->open();
117  }
118  }
119  return b;
120 }
PLog::Level getLogLevel() const
Get the log level of the current PLog.
Definition: PLog.cpp:266
bool streamOpen()
Open the streams.
Definition: PLog.cpp:309
bool open()
Open the current PLog and its children.
Definition: PLog.cpp:104

References getLogAlways(), getLogLevel(), open(), p_isOpen, p_vecLog, phoenix_getDate(), phoenix_logLevelToStr(), and streamOpen().

Referenced by open(), testLogCoutDedirectInFile(), testLogDisable(), testLogStdoutOnly(), testStringLogAppend(), testStringMultiPLog(), testStringPLog(), and testStringPLogLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resize()

void PLog::resize ( size_t  nbThread)

Resize the number of cihldren log file.

Parameters
nbThread: number of sub log files to be created (typically the number of threads of a program)

Definition at line 88 of file PLog.cpp.

88  {
89  clear();
90  p_vecLog.resize(nbThread);
91  PString baseFileName(p_fileName.eraseExtension());
92  PString extention(p_fileName.getExtension());
93  for(size_t i(0lu); i < nbThread; ++i){
94  p_vecLog[i] = new PLog;
95  p_vecLog[i]->setFileName(PString(baseFileName + "_" + PString(valueToString(i)) + "." + extention));
96  p_vecLog[i]->setMode(p_mode);
97  p_vecLog[i]->setLogLevel(p_logLevel);
98  }
99 }
PLog()
Default constructor of PLog.
Definition: PLog.cpp:46
PPath & eraseExtension()
Erase the extension of the PPath.
Definition: PPath.cpp:292
PString getExtension() const
Get file extension.
Definition: PPath.cpp:252
Extends the std::string.
Definition: PString.h:16
std::string valueToString(const T &val)
Convert a type into a string.

References clear(), PPath::eraseExtension(), PPath::getExtension(), p_fileName, p_logLevel, p_mode, p_vecLog, PLog(), and valueToString().

Referenced by testStringMultiPLog().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFileName()

void PLog::setFileName ( const PPath fileName)

Set the output filename of the current PLog.

Parameters
fileName: output filename of the current PLog

Definition at line 60 of file PLog.cpp.

60  {
61  p_fileName = fileName;
62 }

References p_fileName.

Referenced by testLogCoutDedirectInFile(), testLogDisable(), testLogStdoutOnly(), testStringLogAppend(), testStringMultiPLog(), testStringPLog(), and testStringPLogLevel().

+ Here is the caller graph for this function:

◆ setLogLevel()

void PLog::setLogLevel ( PLog::Level  logLevel)

Set the log level of the current PLog.

Parameters
logLevel: log level of the current PLog

Definition at line 74 of file PLog.cpp.

74  {
75  p_logLevel = logLevel;
76 }

References p_logLevel.

Referenced by testStringLogAppend(), and testStringPLogLevel().

+ Here is the caller graph for this function:

◆ setMode()

void PLog::setMode ( PLog::Mode  mode)

Set the mode of the current PLog.

Parameters
mode: mode of the current PLog

Definition at line 67 of file PLog.cpp.

67  {
68  p_mode = mode;
69 }

References p_mode.

Referenced by testLogCoutDedirectInFile(), testLogDisable(), testLogStdoutOnly(), and testStringLogAppend().

+ Here is the caller graph for this function:

◆ setThreadIndex()

void PLog::setThreadIndex ( size_t  threadIndex)

Set the thread index of the current PLog.

Parameters
threadIndex: thread index of the current PLog

Definition at line 81 of file PLog.cpp.

81  {
82  p_threadIndex = threadIndex;
83 }

References p_threadIndex.

Referenced by testStringLogAppend(), and testStringPLog().

+ Here is the caller graph for this function:

◆ streamOpen()

bool PLog::streamOpen ( )
private

Open the streams.

Returns
true on success, false otherwise

Definition at line 309 of file PLog.cpp.

309  {
310  bool b(true);
311  if(p_mode == PLog::FILE_ONLY){
312  p_logFile.open(p_fileName);
313  b &= p_logFile.is_open();
314  if(b){
315  allocateStream(p_logFile.rdbuf());
316  }
317  }else if(p_mode == PLog::STRING_ONLY){
318  std::cerr << "PLog::streamOpen : p_logString.rdbuf() = " << p_logString.rdbuf() << std::endl;
319  allocateStream(p_logString.rdbuf());
321  p_logFile.open(p_fileName);
322  b &= p_logFile.is_open();
323  if(b){
324  p_oldStdCerrBuffer = std::cerr.rdbuf(p_logFile.rdbuf());
325  p_oldStdCoutBuffer = std::cout.rdbuf(p_logFile.rdbuf());
326  allocateStream(p_logFile.rdbuf());
327  }
328  }else if(p_mode == PLog::STDOUT_ONLY){
329  allocateStream(std::cout.rdbuf());
330  }else if(p_mode == PLog::DISABLE){
331  allocateStream(NULL);
332  }
333  return b;
334 }
void allocateStream(std::streambuf *buffer)
Allocate the stream.
Definition: PLog.cpp:299

References allocateStream(), DISABLE, FILE_CAPTURE_STDOUT_STDERR, FILE_ONLY, p_fileName, p_logFile, p_logString, p_mode, p_oldStdCerrBuffer, p_oldStdCoutBuffer, STDOUT_ONLY, and STRING_ONLY.

Referenced by open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ p_fileName

PPath PLog::p_fileName
private

Output filename of the current PLog.

Definition at line 80 of file PLog.h.

Referenced by getFileName(), resize(), setFileName(), and streamOpen().

◆ p_isOpen

bool PLog::p_isOpen
private

True of the log is opened.

Definition at line 96 of file PLog.h.

Referenced by close(), initialisationPLog(), isOpen(), and open().

◆ p_logFile

std::ofstream PLog::p_logFile
private

Current log file to be used.

Definition at line 82 of file PLog.h.

Referenced by close(), getLogFile(), and streamOpen().

◆ p_logLevel

PLog::Level PLog::p_logLevel
private

Current log level of the PLog (all log greater or equal to the p_logLevel will be logged)

Definition at line 78 of file PLog.h.

Referenced by getLog(), getLogLevel(), initialisationPLog(), resize(), and setLogLevel().

◆ p_logString

std::stringstream PLog::p_logString
private

Log string.

Definition at line 84 of file PLog.h.

Referenced by getLogString(), and streamOpen().

◆ p_mode

PLog::Mode PLog::p_mode
private

Mode of the logger.

Definition at line 76 of file PLog.h.

Referenced by getMode(), initialisationPLog(), resize(), setMode(), and streamOpen().

◆ p_nullStream

std::ostream* PLog::p_nullStream
private

Stream used to disable log output.

Definition at line 88 of file PLog.h.

Referenced by getLog(), initialisationPLog(), and ~PLog().

◆ p_oldStdCerrBuffer

std::streambuf* PLog::p_oldStdCerrBuffer
private

Old std::cerr buffer.

Definition at line 90 of file PLog.h.

Referenced by close(), initialisationPLog(), and streamOpen().

◆ p_oldStdCoutBuffer

std::streambuf* PLog::p_oldStdCoutBuffer
private

Old std::cout buffer.

Definition at line 92 of file PLog.h.

Referenced by close(), initialisationPLog(), and streamOpen().

◆ p_stream

std::ostream* PLog::p_stream
private

Current stream to be used to log things.

Definition at line 86 of file PLog.h.

Referenced by allocateStream(), close(), getLog(), and initialisationPLog().

◆ p_threadIndex

size_t PLog::p_threadIndex
private

Index of the current thread.

Definition at line 98 of file PLog.h.

Referenced by getLog(), getThreadIndex(), initialisationPLog(), and setThreadIndex().

◆ p_vecLog

std::vector<PLog*> PLog::p_vecLog
private

Vector of sur log file to be used (mainly for multithreaded programs)

Definition at line 94 of file PLog.h.

Referenced by clear(), close(), getLog(), open(), and resize().


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