TwiceAsNice
2019-02-18
|
#include "indiapi.h"
#include "defaultdevice.h"
#include <stdarg.h>
#include <fstream>
#include <ostream>
#include <string>
#include <sstream>
#include <sys/time.h>
Classes | |
class | INDI::Logger |
The Logger class is a simple logger to log messages to file and INDI clients. More... | |
struct | INDI::Logger::switchinit |
Namespaces | |
INDI | |
Namespace to encapsulate INDI client, drivers, and mediator classes. | |
Macros | |
#define | DEBUG_CONF(outputFile, configuration, fileVerbosityLevel, screenVerbosityLevel) |
Macro to configure the logger. More... | |
#define | DEBUG(priority, msg) INDI::Logger::getInstance().print(getDeviceName(), priority, __FILE__, __LINE__, msg) |
Macro to print log messages. More... | |
#define | DEBUGF(priority, msg, ...) INDI::Logger::getInstance().print(getDeviceName(), priority, __FILE__, __LINE__, msg, __VA_ARGS__) |
#define | DEBUGDEVICE(device, priority, msg) INDI::Logger::getInstance().print(device, priority, __FILE__, __LINE__, msg) |
#define | DEBUGFDEVICE(device, priority, msg, ...) INDI::Logger::getInstance().print(device, priority, __FILE__, __LINE__, msg, __VA_ARGS__) |
#define | LOG_ERROR(txt) DEBUG(INDI::Logger::DBG_ERROR, (txt)) |
Shorter logging macros. More... | |
#define | LOG_WARN(txt) DEBUG(INDI::Logger::DBG_WARNING, (txt)) |
#define | LOG_INFO(txt) DEBUG(INDI::Logger::DBG_SESSION, (txt)) |
#define | LOG_DEBUG(txt) DEBUG(INDI::Logger::DBG_DEBUG, (txt)) |
#define | LOG_EXTRA1(txt) DEBUG(INDI::Logger::DBG_EXTRA_1, (txt)) |
#define | LOG_EXTRA2(txt) DEBUG(INDI::Logger::DBG_EXTRA_2, (txt)) |
#define | LOG_EXTRA3(txt) DEBUG(INDI::Logger::DBG_EXTRA_3, (txt)) |
#define | LOGF_ERROR(fmt, ...) DEBUGF(INDI::Logger::DBG_ERROR, (fmt), __VA_ARGS__) |
#define | LOGF_WARN(fmt, ...) DEBUGF(INDI::Logger::DBG_WARNING, (fmt), __VA_ARGS__) |
#define | LOGF_INFO(fmt, ...) DEBUGF(INDI::Logger::DBG_SESSION, (fmt), __VA_ARGS__) |
#define | LOGF_DEBUG(fmt, ...) DEBUGF(INDI::Logger::DBG_DEBUG, (fmt), __VA_ARGS__) |
#define | LOGF_EXTRA1(fmt, ...) DEBUGF(INDI::Logger::DBG_EXTRA_1, (fmt), __VA_ARGS__) |
#define | LOGF_EXTRA2(fmt, ...) DEBUGF(INDI::Logger::DBG_EXTRA_2, (fmt), __VA_ARGS__) |
#define | LOGF_EXTRA3(fmt, ...) DEBUGF(INDI::Logger::DBG_EXTRA_3, (fmt), __VA_ARGS__) |
Functions | |
Logger::loggerConf | INDI::operator| (Logger::loggerConf __a, Logger::loggerConf __b) |
Logger::loggerConf | INDI::operator & (Logger::loggerConf __a, Logger::loggerConf __b) |
#define DEBUG | ( | priority, | |
msg | |||
) | INDI::Logger::getInstance().print(getDeviceName(), priority, __FILE__, __LINE__, msg) |
Macro to print log messages.
Example of usage of the Logger: DEBUG(DBG_DEBUG, "hello " << "world");
#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 DEBUGDEVICE | ( | device, | |
priority, | |||
msg | |||
) | INDI::Logger::getInstance().print(device, priority, __FILE__, __LINE__, msg) |
#define DEBUGF | ( | priority, | |
msg, | |||
... | |||
) | INDI::Logger::getInstance().print(getDeviceName(), priority, __FILE__, __LINE__, msg, __VA_ARGS__) |
#define DEBUGFDEVICE | ( | device, | |
priority, | |||
msg, | |||
... | |||
) | INDI::Logger::getInstance().print(device, priority, __FILE__, __LINE__, msg, __VA_ARGS__) |
#define LOG_DEBUG | ( | txt | ) | DEBUG(INDI::Logger::DBG_DEBUG, (txt)) |
#define LOG_ERROR | ( | txt | ) | DEBUG(INDI::Logger::DBG_ERROR, (txt)) |
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");
#define LOG_EXTRA1 | ( | txt | ) | DEBUG(INDI::Logger::DBG_EXTRA_1, (txt)) |
#define LOG_EXTRA2 | ( | txt | ) | DEBUG(INDI::Logger::DBG_EXTRA_2, (txt)) |
#define LOG_EXTRA3 | ( | txt | ) | DEBUG(INDI::Logger::DBG_EXTRA_3, (txt)) |
#define LOG_INFO | ( | txt | ) | DEBUG(INDI::Logger::DBG_SESSION, (txt)) |
#define LOG_WARN | ( | txt | ) | DEBUG(INDI::Logger::DBG_WARNING, (txt)) |
#define LOGF_DEBUG | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_DEBUG, (fmt), __VA_ARGS__) |
#define LOGF_ERROR | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_ERROR, (fmt), __VA_ARGS__) |
#define LOGF_EXTRA1 | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_EXTRA_1, (fmt), __VA_ARGS__) |
#define LOGF_EXTRA2 | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_EXTRA_2, (fmt), __VA_ARGS__) |
#define LOGF_EXTRA3 | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_EXTRA_3, (fmt), __VA_ARGS__) |
#define LOGF_INFO | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_SESSION, (fmt), __VA_ARGS__) |
#define LOGF_WARN | ( | fmt, | |
... | |||
) | DEBUGF(INDI::Logger::DBG_WARNING, (fmt), __VA_ARGS__) |