42 log.
getLog() <<
"Some log entry" << std::endl;
43 log.
getLog() <<
"Some other log entry" << std::endl;
54 log.
getLogDebug() <<
"Some other debug log entry" << std::endl;
56 log.
getLog() <<
"Some other info log entry" << std::endl;
57 log.
getLogInfo() <<
"Some other info log entry (again)" << std::endl;
59 log.
getLogWarning() <<
"Some other warning log entry" << std::endl;
61 log.
getLogError() <<
"Some other error log entry" << std::endl;
63 log.
getLogCritical() <<
"Some other critical log entry" << std::endl;
73 log.
getLog() <<
"Log of all threads" << std::endl;
74 for(
size_t i(0lu); i < nbThread; ++i){
76 subLog.
getLog() <<
" i = "<<i<<
", Some log entry" << std::endl;
77 subLog.
getLog() <<
" i = "<<i<<
", Some other log entry" << std::endl;
88 std::cout <<
"Some redirected std::cout stuff" << std::endl;
89 std::cerr <<
"Some redirected std::cerr stuff" << std::endl;
90 log.
getLog() <<
"Some classic log" << std::endl;
102 log.
getLog() <<
"Some log message" << std::endl;
103 log.
getLog() <<
"Some classic log" << std::endl;
114 log.
getLog() <<
"Some log message" << std::endl;
115 log.
getLog() <<
"Some classic log" << std::endl;
125 log.
getLogInfo() <<
"Let's test log append" << std::endl;
134 logStr.
getLogDebug() <<
"Some other debug log entry" << std::endl;
136 logStr.
getLog() <<
"Some other info log entry" << std::endl;
137 logStr.
getLogInfo() <<
"Some other info log entry (again)" << std::endl;
139 log.
getLogInfo() <<
"Some log info at the same time (should be before log append)" << std::endl;
142 logStr.
getLogWarning() <<
"Some other warning log entry" << std::endl;
144 logStr.
getLogError() <<
"Some other error log entry" << std::endl;
146 logStr.
getLogCritical() <<
"Some other critical log entry" << std::endl;
148 log.
getLogInfo() <<
"Just before log append" << std::endl;
152 log.
getLogInfo() <<
"Just after log append" << std::endl;
157 int main(
int argc,
char** argv){
PString phoenix_logLevelToStr(PLog::Level logLevel)
Convert the log level into a PString.
PLog::Level phoenix_strToLogLevel(const PString &str)
Convert a string into a log level.
void setFileName(const PPath &fileName)
Set the output filename of the current PLog.
const PPath & getFileName() const
Get the filename of the current log.
void setThreadIndex(size_t threadIndex)
Set the thread index of the current PLog.
void close()
Close the current PLog and its children.
std::stringstream & getLogString()
Get the log string.
void resize(size_t nbThread)
Resize the number of cihldren log file.
size_t getThreadIndex() const
Get the thread index of the current PLog.
std::ostream & getLogDebug()
Write debug message into the PLog.
PLog & getLog(size_t threadIndex)
Get the PLog at given index.
std::ostream & getLogInfo()
Write info message into the PLog.
void setMode(PLog::Mode mode)
Set the mode of the current PLog.
bool isOpen() const
Say if the current PLog is opened or not.
std::ostream & getLogWarning()
Write warning message into the PLog.
@ FILE_CAPTURE_STDOUT_STDERR
void setLogLevel(PLog::Level logLevel)
Set the log level of the current PLog.
bool open()
Open the current PLog and its children.
std::ostream & getLogCritical()
Write critical message into the PLog.
void appendLog(std::stringstream &str)
Append the log (STRING_ONLY mode) into an other log.
std::ostream & getLogError()
Write error message into the PLog.
Path of a directory or a file.
#define phoenix_assert(isOk)
int main(int argc, char **argv)
void testLogStdoutOnly()
Test if the std::cout redirection is working.
void testStringMultiPLog()
Test the PLog.
void testStringToLogLevel()
Test the conversion of string into log level.
void testStringLogAppend()
Test if the STRING_ONLY log mode works.
void testLogDisable()
Test if the std::cout redirection is working.
void testLogLevelToString()
Test the conversion of log level into string.
void testStringPLogLevel()
Test the PLog.
void testStringPLog()
Test the PLog.
void testLogCoutDedirectInFile()
Test if the std::cout redirection is working.