 |
PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
|
Go to the documentation of this file.
95 for(
size_t i(0lu); i < nbThread; ++i){
111 getLogAlways() <<
"[UTC][Date][ThreadIndex][LogLevel] : log message" << std::endl;
115 for(std::vector<PLog*>::iterator it(
p_vecLog.begin()); it !=
p_vecLog.end(); ++it){
146 for(std::vector<PLog*>::iterator it(
p_vecLog.begin()); it !=
p_vecLog.end(); ++it){
157 for(std::vector<PLog*>::iterator it(
p_vecLog.begin()); it !=
p_vecLog.end(); ++it){
298 p_stream =
new std::ostream(buffer);
313 std::cerr <<
"PLog::streamOpen : p_logString.rdbuf() = " <<
p_logString.rdbuf() << std::endl;
void setThreadIndex(size_t threadIndex)
Set the thread index of the current PLog.
std::string convertToString(const T &val)
Convert a type into a string.
PLog & getLog(size_t threadIndex)
Get the PLog at given index.
const std::string & getFileName() const
Get the filename of the current log.
void initialisationPLog()
Initialisation function of the class PLog.
Mode
Mode to be used on the logger.
std::ostream & getLogError()
Write error message into the PLog.
void allocateStream(std::streambuf *buffer)
Allocate the stream.
void close()
Close the current PLog and its children.
std::ostream & getLogAlways()
Write always message into the PLog.
void appendLog(std::stringstream &str)
Append the log (STRING_ONLY mode) into an other log.
std::ostream & getLogWarning()
Write warning message into the PLog.
void setFileName(const std::string &fileName)
Set the output filename of the current PLog.
std::string phoenix_logLevelToStr(PLog::Level logLevel)
Convert the log level into a string.
@ FILE_CAPTURE_STDOUT_STDERR
std::ofstream p_logFile
Current log file to be used.
bool p_isOpen
True of the log is opened.
void clear()
Clear the children of the current PLog.
PLog::Level getLogLevel() const
Get the log level of the current PLog.
void setLogLevel(PLog::Level logLevel)
Set the log level of the current PLog.
std::streambuf * p_oldStdCoutBuffer
Old std::cout buffer.
std::ostream & getLogDebug()
Write debug message into the PLog.
std::ostream * p_stream
Current stream to be used to log things.
virtual ~PLog()
Destructor of PLog.
std::ostream & getLogInfo()
Write info message into the PLog.
void resize(size_t nbThread)
Resize the number of cihldren log file.
void setMode(PLog::Mode mode)
Set the mode of the current PLog.
bool open()
Open the current PLog and its children.
bool streamOpen()
Open the streams.
std::string eraseExtension(const std::string &fileName)
Erase extention of the given file.
std::string p_fileName
Output filename of the current PLog.
PLog::Mode getMode() const
Get the mode of the current PLog.
std::ostream * p_nullStream
Stream used to disable log output.
std::vector< PLog * > p_vecLog
Vector of sur log file to be used (mainly for multithreaded programs)
time_t phoenix_getTime()
Get the current time of the program.
std::ofstream & getLogFile()
Get the current log file.
std::streambuf * p_oldStdCerrBuffer
Old std::cerr buffer.
std::string phoenix_getDateCompact()
Get the current date.
std::string phoenix_getDate()
Get the current date.
std::stringstream & getLogString()
Get the log string.
PLog::Level p_logLevel
Current log level of the PLog (all log greater or equal to the p_logLevel will be logged)
size_t p_threadIndex
Index of the current thread.
std::string getExtention(const std::string &fileName)
Get file extention.
std::stringstream p_logString
Log string.
std::ostream & getLogCritical()
Write critical message into the PLog.
Level
Log level to be used in the logger.
PLog::Mode p_mode
Mode of the logger.
size_t getThreadIndex() const
Get the thread index of the current PLog.
PLog()
Default constructor of PLog.
PLog::Level phoenix_strToLogLevel(const std::string &str)
Convert a string into a log level.