#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/uuid/uuid.hpp>
#include <funapi/types.h>
#include <glog/logging.h>
#include <vector>
#include <string>
Go to the source code of this file.
|
#define | LOG_ONCE_WHILE(lv, interval) |
|
#define | LOW_CONCAT(a, b) LOW_CONCAT_HELPER(a, b) |
|
#define | LOW_CONCAT_HELPER(a, b) a##b |
|
#define | LOW_COUNT1 LOW_CONCAT(log_count1_, __LINE__) |
|
#define | LOW_COUNT2 LOW_CONCAT(log_count2_, __LINE__) |
|
#define | LOW_GET_CTXT LOW_CONCAT(get_ctxt_, __LINE__) |
|
#define | LOW_LAST LOW_CONCAT(log_last_, __LINE__) |
|
|
typedef std::vector< LogColumnCppType > | fun::LoggerColumnCppTypes |
|
typedef std::vector< string > | fun::LoggerColumnNames |
|
typedef std::vector< bool > | fun::LoggerColumnQuotes |
|
typedef std::vector< string > | fun::LoggerColumnValues |
|
|
enum | LogColumnCppType {
LCT_BOOL,
LCT_TIME_T,
LCT_WALLCLOCK_VALUE,
LCT_DOUBLE,
LCT_INT64,
LCT_STRING
} |
|
|
FUNAPI_DLL_VISIBILITY void | fun::LogActivity (const string &activityType, const LoggerColumnValues &values) |
|
◆ LOG_ONCE_WHILE
#define LOG_ONCE_WHILE |
( |
|
lv, |
|
|
|
interval |
|
) |
| |
Value:static size_t LOW_COUNT1 = 0; \
static size_t LOW_COUNT2 = 0; \
static MonotonicClock::Value LOW_LAST = 0; \
static function<bool()> LOW_GET_CTXT = []( ) { \
++LOW_COUNT1; \
if ((MonotonicClock::Now() - LOW_LAST) >= (interval * 1000 * 1000)) { \
LOW_LAST = MonotonicClock::Now(); \
LOW_COUNT2 = LOW_COUNT1; \
LOW_COUNT1 = 0; \
return true; \
} \
return false; \
}; \
LOG_IF(lv, LOW_GET_CTXT()) << "(#" << LOW_COUNT2 << ") "