Logging routines and macros. More...
#include "Error.h"
#include "String.h"
#include <iostream>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include "FixedStream.h"
Go to the source code of this file.
Classes | |
class | Hypertable::Logger::LogWriter |
The LogWriter class writes to stdout. More... | |
Namespaces | |
Hypertable | |
Hypertable definitions | |
Hypertable::Logger | |
Logging framework. | |
Hypertable::Logger::Priority | |
Output priorities modelled after syslog. | |
Macros | |
#define | HT_LOG_BUFSZ 1024 |
#define | HT_ABORT raise(SIGABRT) |
#define | HT_LOG(priority, msg) |
#define | HT_LOGF(priority, fmt,...) |
#define | HT_LOG_BUF_SIZE 4096 |
#define | HT_OUT(priority) |
#define | HT_OUT2(priority) |
#define | HT_END |
#define | HT_OUT_DISABLED do { if (0) { |
#define | HT_DUMP_CSTR(_os_, _label_, _str_) |
#define | HT_DUMP_CSTR_FIELD(_os_, _obj_, _field_) HT_DUMP_CSTR(_os_, _field_, _obj_._field_) |
#define | HT_LOG_ENTER |
#define | HT_LOG_EXIT |
#define | HT_DEBUG(msg) HT_LOG(Logger::Priority::DEBUG, msg) |
#define | HT_DEBUGF(msg,...) HT_LOGF(Logger::Priority::DEBUG, msg, __VA_ARGS__) |
#define | HT_DEBUG_OUT HT_OUT2(Logger::Priority::DEBUG) |
#define | HT_INFO(msg) HT_LOG(Logger::Priority::INFO, msg) |
#define | HT_INFOF(msg,...) HT_LOGF(Logger::Priority::INFO, msg, __VA_ARGS__) |
#define | HT_NOTICE(msg) HT_LOG(Logger::Priority::NOTICE, msg) |
#define | HT_NOTICEF(msg,...) HT_LOGF(Logger::Priority::NOTICE, msg, __VA_ARGS__) |
#define | HT_NOTICE_OUT HT_OUT(Logger::Priority::NOTICE) |
#define | HT_WARN(msg) HT_LOG(Logger::Priority::WARN, msg) |
#define | HT_WARNF(msg,...) HT_LOGF(Logger::Priority::WARN, msg, __VA_ARGS__) |
#define | HT_WARN_OUT HT_OUT2(Logger::Priority::WARN) |
#define | HT_ERROR(msg) HT_LOG(Logger::Priority::ERROR, msg) |
#define | HT_ERRORF(msg,...) HT_LOGF(Logger::Priority::ERROR, msg, __VA_ARGS__) |
#define | HT_ERROR_OUT HT_OUT2(Logger::Priority::ERROR) |
#define | HT_CRIT(msg) HT_LOG(Logger::Priority::CRIT, msg) |
#define | HT_CRITF(msg,...) HT_LOGF(Logger::Priority::CRIT, msg, __VA_ARGS__) |
#define | HT_CRIT_OUT HT_OUT2(Logger::Priority::CRIT) |
#define | HT_ALERT(msg) HT_LOG(Logger::Priority::ALERT, msg) |
#define | HT_ALERTF(msg,...) HT_LOGF(Logger::Priority::ALERT, msg, __VA_ARGS__) |
#define | HT_ALERT_OUT HT_OUT2(Logger::Priority::ALERT) |
#define | HT_EMERG(msg) HT_LOG(Logger::Priority::EMERG, msg) |
#define | HT_EMERGF(msg,...) HT_LOGF(Logger::Priority::EMERG, msg, __VA_ARGS__) |
#define | HT_EMERG_OUT HT_OUT2(Logger::Priority::EMERG) |
#define | HT_FATAL(msg) |
#define | HT_FATALF(msg,...) |
#define | HT_FATAL_OUT HT_OUT2(Logger::Priority::FATAL) |
#define | HT_EXPECT(_e_, _code_) |
#define | HT_ASSERT(_e_) HT_EXPECT(_e_, Error::FAILED_EXPECTATION) |
Functions | |
void | Hypertable::Logger::initialize (const String &name) |
Public initialization function - creates a singleton instance of LogWriter. More... | |
LogWriter * | Hypertable::Logger::get () |
Accessor for the LogWriter singleton instance. More... | |
Logging routines and macros.
The LogWriter provides facilities to write debug, log, error- and other messages to stdout. The Logging namespaces provides std::ostream- and printf-like macros and convenience functions.
Definition in file Logger.h.
#define HT_ALERT | ( | msg | ) | HT_LOG(Logger::Priority::ALERT, msg) |
#define HT_ALERTF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::ALERT, msg, __VA_ARGS__) |
#define HT_ASSERT | ( | _e_ | ) | HT_EXPECT(_e_, Error::FAILED_EXPECTATION) |
#define HT_CRITF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::CRIT, msg, __VA_ARGS__) |
#define HT_DEBUG | ( | msg | ) | HT_LOG(Logger::Priority::DEBUG, msg) |
#define HT_DEBUGF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::DEBUG, msg, __VA_ARGS__) |
#define HT_DUMP_CSTR | ( | _os_, | |
_label_, | |||
_str_ | |||
) |
#define HT_DUMP_CSTR_FIELD | ( | _os_, | |
_obj_, | |||
_field_ | |||
) | HT_DUMP_CSTR(_os_, _field_, _obj_._field_) |
#define HT_EMERG | ( | msg | ) | HT_LOG(Logger::Priority::EMERG, msg) |
#define HT_EMERGF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::EMERG, msg, __VA_ARGS__) |
#define HT_END |
#define HT_ERROR | ( | msg | ) | HT_LOG(Logger::Priority::ERROR, msg) |
#define HT_ERRORF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::ERROR, msg, __VA_ARGS__) |
#define HT_EXPECT | ( | _e_, | |
_code_ | |||
) |
#define HT_FATAL | ( | msg | ) |
#define HT_FATALF | ( | msg, | |
... | |||
) |
#define HT_INFOF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::INFO, msg, __VA_ARGS__) |
#define HT_LOG | ( | priority, | |
msg | |||
) |
#define HT_LOG_ENTER |
#define HT_LOG_EXIT |
#define HT_LOGF | ( | priority, | |
fmt, | |||
... | |||
) |
#define HT_NOTICE | ( | msg | ) | HT_LOG(Logger::Priority::NOTICE, msg) |
#define HT_NOTICEF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::NOTICE, msg, __VA_ARGS__) |
#define HT_OUT | ( | priority | ) |
#define HT_OUT2 | ( | priority | ) |
#define HT_WARN | ( | msg | ) | HT_LOG(Logger::Priority::WARN, msg) |
#define HT_WARN_OUT HT_OUT2(Logger::Priority::WARN) |
#define HT_WARNF | ( | msg, | |
... | |||
) | HT_LOGF(Logger::Priority::WARN, msg, __VA_ARGS__) |