![]() |
Computer Assited Medical Intervention Tool Kit
version 3.2
|
This class is a log utility. More...
#include <Log.h>
Static Public Member Functions | |
static void | closeLogFile () |
Method used to close the log File. More... | |
static std::ostream * | getLogStream () |
get the logFile (singleton) More... | |
static bool | getShowTime () |
get show time information More... | |
static bool | getShowUser () |
get the status of show user information More... | |
static std::string | getUserInformation () |
get the user information More... | |
static void | openLogFile () |
Method used to open the log File. More... | |
static void | showTime (bool) |
show date/time information in logs More... | |
static void | showUser (bool) |
show or not the user information More... | |
Static Private Attributes | |
static std::ofstream * | logFilePtr |
the log file More... | |
static bool | showTimeInfo |
show time info More... | |
static bool | showUserInfo |
show user info More... | |
This class is a log utility.
It helps you to log messages anywhere in your code for different levels: CAMITK_INFO, CAMITK_ERROR, CAMITK_WARNING and CAMITK_DEBUG. Log macro CAMITK_INFO is always enabled.
Logs are defined by macros, which can be switch off at compile time. The log behaviour is defined directly by the value of 2 cmake variables: CAMITK_LOG_FILE and CAMITK_LOG_LEVEL.
For CAMITK_LOG_LEVEL consider the following table:
CAMITK_LOG_LEVEL | Enabled macros |
0 | CAMITK_ERROR |
1 | CAMITK_ERROR / CAMITK_WARNING |
2 | CAMITK_ERROR / CAMITK_WARNING / CAMITK_DEBUG |
For CAMITK_LOG_FILE: You can choose to save logs into "log.txt" file in the executable directory. If this file does not exist, it is automatically created when the application is executed. This option is configured by cmake variable CAMITK_LOG_FILE.
How to use the macro in the source:
Example : CAMITK_INFO("class used", "method used", "message" << std::endl);
|
static |
Method used to close the log File.
|
static |
get the logFile (singleton)
|
static |
get show time information
|
static |
get the status of show user information
|
static |
get the user information
|
static |
Method used to open the log File.
|
static |
show date/time information in logs
|
static |
show or not the user information
|
staticprivate |
the log file
|
staticprivate |
show time info
|
staticprivate |
show user info