ocssw
V2022
|
#include <VcstLogger.h>
Public Types | |
enum | Level { DBG_OFF = 0, DBG_HIGH, DBG_MED, DBG_LOW } |
enum | LoggingDest { STDOUT = 0, LOGFILE } |
Public Member Functions | |
virtual | ~VcstLogger () |
void | init (VcstLogger::Level level, VcstLogger::LoggingDest dest, std::string processName, std::string path=".") |
void | init (std::string level, std::string dest, std::string processName, std::string path=".") |
bool | isDebugHighEnabled () |
bool | isDebugMedEnabled () |
bool | isDebugLowEnabled () |
void | debugHigh (std::string msg, const char *file, const int line) |
void | debugMed (std::string msg, const char *file, const int line) |
void | debugLow (std::string msg, const char *file, const int line) |
void | log (std::string strLog, VcstLogger::Level level, std::string msg, const char *file, const int line) |
bool | isEnabledFor (VcstLogger::Level level) |
Static Public Member Functions | |
static VcstLogger & | getLogger () |
static VcstLogger * | setLogger (VcstLogger *aLogger) |
static const char * | errorAsStr (int status) |
static bool | wasError (int status) |
Detailed Description
This class provides logging capabilities for the ADL environment. Debug messages can be set to off, low, medium, or high and can be sent to the console or to a log file.
Definition at line 25 of file VcstLogger.h.
Member Enumeration Documentation
◆ Level
enum Level |
Logger detail levels.
Enumerator | |
---|---|
DBG_OFF | |
DBG_HIGH | |
DBG_MED | |
DBG_LOW |
Definition at line 42 of file VcstLogger.h.
◆ LoggingDest
enum LoggingDest |
Constructor & Destructor Documentation
◆ ~VcstLogger()
|
virtual |
Destructor
Member Function Documentation
◆ debugHigh()
void debugHigh | ( | std::string | msg, |
const char * | file, | ||
const int | line | ||
) |
Logs a HIGH debug message.
- Parameters
-
msg The debug message to send. file The name of the file this message was sent from. line The line number this message was sent from.
◆ debugLow()
void debugLow | ( | std::string | msg, |
const char * | file, | ||
const int | line | ||
) |
Logs a LOW debug message.
- Parameters
-
msg The debug message to send. file The name of the file this message was sent from. line The line number this message was sent from.
◆ debugMed()
void debugMed | ( | std::string | msg, |
const char * | file, | ||
const int | line | ||
) |
Logs a MED debug message.
- Parameters
-
msg The debug message to send. file The name of the file this message was sent from. line The line number this message was sent from.
◆ errorAsStr()
|
static |
Translate a return error number into a string.
- Parameters
-
status,one of PRO_FAIL, PRO_SUCCESS, ... (see Typedefs.h>
- Return values
-
string representation of the error code.
◆ getLogger()
|
static |
Get visibility to the reference to the INF logging service implementation.
◆ init() [1/2]
void init | ( | std::string | level, |
std::string | dest, | ||
std::string | processName, | ||
std::string | path = "." |
||
) |
Initialize my logger. Sets the logging detail level retrieved from the algorithm execution XML file.
This init method calls the version of init which takes enum values to do the actual initialization.
- Parameters
-
level A string value representing the log level. dest A string value representing the message destination (STDOUT or a log file). processName The name of the executable that is running. path The path where the log file will be written.
◆ init() [2/2]
void init | ( | VcstLogger::Level | level, |
VcstLogger::LoggingDest | dest, | ||
std::string | processName, | ||
std::string | path = "." |
||
) |
Initialize my logger. Sets the logging detail level retrieved from the algorithm execution XML file.
- Parameters
-
level An enum value representing the log level. dest An enum value representing the message destination (STDOUT or a log file). processName The name of the executable that is running. path The path where the log file will be written.
◆ isDebugHighEnabled()
bool isDebugHighEnabled | ( | ) |
Returns whether or not DBG_HIGH is enabled.
- Return values
-
true if DBG_HIGH is enabled.
◆ isDebugLowEnabled()
bool isDebugLowEnabled | ( | ) |
Returns whether or not DBG_LOW is enabled.
- Return values
-
true if DBG_LOW is enabled.
◆ isDebugMedEnabled()
bool isDebugMedEnabled | ( | ) |
Returns whether or not DBG_MED is enabled.
- Return values
-
true if DBG_MED is enabled.
◆ isEnabledFor()
bool isEnabledFor | ( | VcstLogger::Level | level | ) |
Returns whether or not level is enabled
◆ log()
void log | ( | std::string | strLog, |
VcstLogger::Level | level, | ||
std::string | msg, | ||
const char * | file, | ||
const int | line | ||
) |
Logs a debug message.
◆ setLogger()
|
static |
Setter for our logger instance. My implementation of the VcstLoggerGCIF interface method.
- Parameters
-
aLogger A new logger instance. My garbage collector deletes this memory.
- Return values
-
The old logger instance. My caller is responsible for deleting this memory.
◆ wasError()
|
static |
Determine if a given error level is an error case or not.
- Parameters
-
status,one of PRO_FAIL, PRO_SUCCESS, ... (see Typedefs.h>
- Return values
-
false if the error was PRO_SUCCESS, else return false.
The documentation for this class was generated from the following file:
- /gfs-oceanweb/web/ocssw/ocssw_src/include/ViirsCmn/VcstLogger.h