iFun Engine API  1.0.0-b6053
Great Technology for Great Games
Classes | Macros | Typedefs | Enumerations | Functions
logging.h File Reference
#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.

Classes

class  fun::LoggerRegistryHelper
 Helper class to register user-defined activity log. More...
 

Macros

#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__)
 

Typedefs

typedef std::vector< LogColumnCppType > fun::LoggerColumnCppTypes
 
typedef std::vector< string > fun::LoggerColumnNames
 
typedef std::vector< bool > fun::LoggerColumnQuotes
 
typedef std::vector< string > fun::LoggerColumnValues
 

Enumerations

enum  LogColumnCppType {
  LCT_BOOL, LCT_TIME_T, LCT_WALLCLOCK_VALUE, LCT_DOUBLE,
  LCT_INT64, LCT_STRING
}
 

Functions

FUNAPI_DLL_VISIBILITY void fun::LogActivity (const string &activityType, const LoggerColumnValues &values)
 

Macro Definition Documentation

◆ 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 << ") "