#include "indiapi.h"
#include "defaultdevice.h"
#include <stdarg.h>
#include <fstream>
#include <ostream>
#include <string>
#include <sstream>
#include <sys/time.h>
Go to the source code of this file.
|
| class | INDI::Logger |
| | The Logger class is a simple logger to log messages to file and INDI clients. This is the implementation of a simple logger in C++. It is implemented as a Singleton, so it can be easily called through two DEBUG macros. It is Pthread-safe. It allows to log on both file and screen, and to specify a verbosity threshold for both of them. More...
|
| struct | INDI::Logger::switchinit |
|
| namespace | INDI |
| | Namespace to encapsulate INDI client, drivers, and mediator classes.
|
|
| #define | DEBUG_CONF(outputFile, configuration, fileVerbosityLevel, screenVerbosityLevel) |
| | Macro to configure the logger. Example of configuration of the Logger: DEBUG_CONF("outputfile", Logger::file_on|Logger::screen_on, DBG_DEBUG, DBG_ERROR);.
|
| #define | DEBUG(priority, msg) |
| | Macro to print log messages. Example of usage of the Logger: DEBUG(DBG_DEBUG, "hello " << "world");.
|
| #define | DEBUGF(priority, msg, ...) |
| #define | DEBUGDEVICE(device, priority, msg) |
| #define | DEBUGFDEVICE(device, priority, msg, ...) |
| #define | LOG_ERROR(txt) |
| | Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must be defined in the calling scope.
|
| #define | LOG_WARN(txt) |
| #define | LOG_INFO(txt) |
| #define | LOG_DEBUG(txt) |
| #define | LOG_EXTRA1(txt) |
| #define | LOG_EXTRA2(txt) |
| #define | LOG_EXTRA3(txt) |
| #define | LOGF_ERROR(fmt, ...) |
| #define | LOGF_WARN(fmt, ...) |
| #define | LOGF_INFO(fmt, ...) |
| #define | LOGF_DEBUG(fmt, ...) |
| #define | LOGF_EXTRA1(fmt, ...) |
| #define | LOGF_EXTRA2(fmt, ...) |
| #define | LOGF_EXTRA3(fmt, ...) |
◆ DEBUG
| #define DEBUG |
( |
| priority, |
|
|
| msg ) |
Value:
void print(const char *devicename, const unsigned int verbosityLevel, const std::string &sourceFile, const int codeLine, const char *message,...)
static Logger & getInstance()
Method to get a reference to the object (i.e., Singleton) It is a static method.
Macro to print log messages. Example of usage of the Logger: DEBUG(DBG_DEBUG, "hello " << "world");.
Definition at line 56 of file indilogger.h.
◆ DEBUG_CONF
| #define DEBUG_CONF |
( |
| outputFile, |
|
|
| configuration, |
|
|
| fileVerbosityLevel, |
|
|
| screenVerbosityLevel ) |
Value: { \
Logger::getInstance().configure(outputFile, configuration, fileVerbosityLevel, screenVerbosityLevel); \
}
Macro to configure the logger. Example of configuration of the Logger: DEBUG_CONF("outputfile", Logger::file_on|Logger::screen_on, DBG_DEBUG, DBG_ERROR);.
Definition at line 38 of file indilogger.h.
◆ DEBUGDEVICE
| #define DEBUGDEVICE |
( |
| device, |
|
|
| priority, |
|
|
| msg ) |
◆ DEBUGF
| #define DEBUGF |
( |
| priority, |
|
|
| msg, |
|
|
| ... ) |
◆ DEBUGFDEVICE
| #define DEBUGFDEVICE |
( |
| device, |
|
|
| priority, |
|
|
| msg, |
|
|
| ... ) |
◆ LOG_DEBUG
Value:
#define DEBUG(priority, msg)
Macro to print log messages. Example of usage of the Logger: DEBUG(DBG_DEBUG, "hello " << "world");.
Definition at line 75 of file indilogger.h.
◆ LOG_ERROR
Value:
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must be defined in the calling scope.
Usage examples: LOG_DEBUG("hello " << "world"); LOGF_WARN("hello %s", "world");
Definition at line 72 of file indilogger.h.
◆ LOG_EXTRA1
| #define LOG_EXTRA1 |
( |
| txt | ) |
|
◆ LOG_EXTRA2
| #define LOG_EXTRA2 |
( |
| txt | ) |
|
◆ LOG_EXTRA3
| #define LOG_EXTRA3 |
( |
| txt | ) |
|
◆ LOG_INFO
◆ LOG_WARN
◆ LOGF_DEBUG
| #define LOGF_DEBUG |
( |
| fmt, |
|
|
| ... ) |
Value:
std::string fmt(const char *fmt,...)
#define DEBUGF(priority, msg,...)
Definition at line 83 of file indilogger.h.
◆ LOGF_ERROR
| #define LOGF_ERROR |
( |
| fmt, |
|
|
| ... ) |
◆ LOGF_EXTRA1
| #define LOGF_EXTRA1 |
( |
| fmt, |
|
|
| ... ) |
◆ LOGF_EXTRA2
| #define LOGF_EXTRA2 |
( |
| fmt, |
|
|
| ... ) |
◆ LOGF_EXTRA3
| #define LOGF_EXTRA3 |
( |
| fmt, |
|
|
| ... ) |
◆ LOGF_INFO
| #define LOGF_INFO |
( |
| fmt, |
|
|
| ... ) |
◆ LOGF_WARN
| #define LOGF_WARN |
( |
| fmt, |
|
|
| ... ) |