PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
PLog.h File Reference
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include "PPath.h"
+ Include dependency graph for PLog.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PLog
 Phoenix Logger. More...
 

Functions

PString phoenix_logLevelToStr (PLog::Level logLevel)
 Convert the log level into a PString. More...
 
PLog::Level phoenix_strToLogLevel (const PString &str)
 Convert a string into a log level. More...
 

Function Documentation

◆ phoenix_logLevelToStr()

PString phoenix_logLevelToStr ( PLog::Level  logLevel)

Convert the log level into a PString.

Parameters
logLevel: log level to be converted
Returns
corresponding PString

Definition at line 15 of file PLog.cpp.

15  {
16  switch(logLevel){
17  case PLog::INFO:
18  return "INFO";
19  case PLog::WARNING:
20  return "WARNING";
21  case PLog::ERROR:
22  return "ERROR";
23  case PLog::CRITICAL:
24  return "CRITICAL";
25  case PLog::ALWAYS:
26  return "ALWAYS";
27  default:
28  return "DEBUG";
29  }
30 }
@ CRITICAL
Definition: PLog.h:37
@ INFO
Definition: PLog.h:34
@ ERROR
Definition: PLog.h:36
@ ALWAYS
Definition: PLog.h:38
@ WARNING
Definition: PLog.h:35

References PLog::ALWAYS, PLog::CRITICAL, PLog::ERROR, PLog::INFO, and PLog::WARNING.

Referenced by PLog::getLog(), PLog::open(), and testLogLevelToString().

+ Here is the caller graph for this function:

◆ phoenix_strToLogLevel()

PLog::Level phoenix_strToLogLevel ( const PString str)

Convert a string into a log level.

Parameters
str: string ot be converted
Returns
corresponding PLog::Level

Definition at line 36 of file PLog.cpp.

36  {
37  if(str == "DEBUG"){return PLog::DEBUG;}
38  else if(str == "WARNING"){return PLog::WARNING;}
39  else if(str == "ERROR"){return PLog::ERROR;}
40  else if(str == "CRITICAL"){return PLog::CRITICAL;}
41  else if(str == "ALWAYS"){return PLog::ALWAYS;}
42  else{return PLog::INFO;}
43 }
@ DEBUG
Definition: PLog.h:33

References PLog::ALWAYS, PLog::CRITICAL, PLog::DEBUG, PLog::ERROR, PLog::INFO, and PLog::WARNING.

Referenced by testStringToLogLevel().

+ Here is the caller graph for this function: