B2BITS FIX Antenna HFT
1.0.16
|
#include <b2b_platform.h>
#include <stdio.h>
#include <stdarg.h>
#include <B2BITS_LogCategory.h>
#include <B2BITS_LogSystem.h>
#include <FE_SYS_Time.h>
#include <RawBuffer.h>
Classes | |
struct | LogClientData |
Namespaces | |
Parser | |
Macros | |
#define | DEF_LOG_THROTTLE_MILLIS 1000 |
#define | IF_LOGLEVEL_AT(_logLevel) (g_platformProps.logLevel >= (_logLevel) ) |
#define | IF_LOGLEVEL_DEBUG(text) do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) { text } } while(0) |
#define | IF_LOGLEVEL_DEBUG_VERBOSE(text) do { } while(0) |
#define | IF_LOGLEVEL_ERROR(text) do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) { text } } while(0) |
#define | IF_LOGLEVEL_FATAL(text) do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) { text } } while(0) |
#define | IF_LOGLEVEL_INFO(text) do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_INFO)) { text } } while(0) |
#define | IF_LOGLEVEL_WARN(text) do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) { text } } while(0) |
#define | LOG_ALWAYS(fmt,...) do { log_out( 0, LOG_LEVEL_ALWAYS, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_CMD_BUF_SIZE 256 |
#define | LOG_DEBUG(fmt,...) do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) log_out( 0, LOG_LEVEL_DEBUG, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_DEBUG_VERBOSE(fmt,...) do { } while(0) |
#define | LOG_ERROR(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) log_out( 0, LOG_LEVEL_ERROR, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_ALWAYS(fmt,...) do { log_out( 1, LOG_LEVEL_ALWAYS, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_DEBUG(fmt,...) do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) log_out( 1, LOG_LEVEL_DEBUG, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_DEBUG_VERBOSE(fmt,...) do { } while(0) |
#define | LOG_FAST_ERROR(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) log_out( 1, LOG_LEVEL_ERROR, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_FATAL(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) log_out( 1, LOG_LEVEL_FATAL, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_INFO(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_INFO) log_out( 1, LOG_LEVEL_INFO, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_ON_LEVEL(_logLevel, fmt,...) do { if (g_platformProps.logLevel >= (_logLevel)) log_out( 1, (_logLevel), (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FAST_WARN(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) log_out( 1, LOG_LEVEL_WARN, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_FATAL(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) log_out( 0, LOG_LEVEL_FATAL, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_INFO(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_INFO) log_out( 0, LOG_LEVEL_INFO, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_ON_LEVEL(_logLevel, fmt,...) do { if (g_platformProps.logLevel >= (_logLevel)) log_out( 0, (_logLevel), (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_SK_ALWAYS(sessionID, srv, sock, fmt,...) do { log_out( 0, LOG_LEVEL_ALWAYS, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_SK_DEBUG(sessionID, srv, sock, fmt,...) do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) log_out( 0, LOG_LEVEL_DEBUG, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_SK_DEBUG_VERBOSE(sessionID, srv, sock, fmt,...) do { } while(0) |
#define | LOG_SK_ERROR(sessionID, srv, sock, fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) log_out( 0, LOG_LEVEL_ERROR, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_SK_FATAL(sessionID, srv, sock, fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) log_out( 0, LOG_LEVEL_FATAL, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_SK_INFO(sessionID, srv, sock, fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_INFO) log_out( 0, LOG_LEVEL_INFO, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_SK_WARN(sessionID, srv, sock, fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) log_out( 0, LOG_LEVEL_WARN, (fmt), ##__VA_ARGS__ ); } while(0) |
#define | LOG_WARN(fmt,...) do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) log_out( 0, LOG_LEVEL_WARN, (fmt), ##__VA_ARGS__ ); } while(0) |
Enumerations | |
enum | ThrottleLogCase { LOG_DROPCOPY_FULL = 0, LOG_HASH_FULL, LOG_ORDER_TABLE_STATS, LOG_ROUTE_QUEUE, LAST_ThrottleLogCase } |
Functions | |
__attribute__ ((aligned(64))) extern atom_t last_log_millis[LAST_ThrottleLogCase] | |
static int | _throttle_log (enum ThrottleLogCase caseNum, int rate_ctl_millis) |
V12_API void | broadcast_log_to_tcp_clients (char *buf, int len) |
V12_API void | doLogOut (enum PlatformLogLevel logLevel, struct Server *srv, char *text, int len) |
V12_API void | initLogServer () |
V12_API void | initThreadLoggerClient () |
V12_API void | launch_logger_thread () |
Starts the async logger thread. More... | |
int V12_API | log_out (int fast, enum PlatformLogLevel level, const char *fmt,...) __attribute__((format(printf |
int V12_API int | log_outh (int fast, enum PlatformLogLevel level, const char *header, int header_len, const char *fmt,...) __attribute__((format(printf |
V12_API void | log_shell_greeting (struct Socket *sock) |
int V12_API int void void V12_API void | log_shell_read_input (char *data_buf, struct Socket *sock, const char *buf, int len) |
V12_API char * | printdata (const char *preambula, const char *buffer, int len, char *printdata_buf, int printdata_buf_len) |
V12_API void | printdata_hex (void *data, unsigned int len) |
void | printUTCTimestampWithMs (FILE *f) |
V12_API void | prompt (struct Socket *sock) |
V12_API void | register_log_input_queue_client (struct Fifo *channel) |
V12_API void | register_log_queue_client (struct MessageQueue *channel) |
int V12_API int void | remote_alert (char severity, const char *subject, const char *fmt,...) __attribute__((format(printf |
int V12_API int void void | remote_risk_alert (char severity, char scope, int rule, Account *account, const char *clordid, int clordid_len, const char *subject, const char *fmt,...) __attribute__((format(printf |
V12_API void | run_main_thread_shell () |
V12_API void | setLogLevel (const char *param, Utils::Log::LogCategory *engineLog) |
static int | throttle_log (enum ThrottleLogCase caseNum) |
int | vlog_out (int fast, enum PlatformLogLevel level, const char *header, int header_len, const char *fmt, va_list va, bool writeToLog=true, Utils::RawBuffer *appendToBuffer=NULL) |
void | vremote_alert (char severity, const char *subject, const char *fmt, va_list va) |
V12_API void | writeToSocket (struct Socket *sock, const char *str) |
Variables | |
V12_API struct NetworkDeclaration | LOGGER_NETWORK |
const char * | logLevelNames [] |
#define DEF_LOG_THROTTLE_MILLIS 1000 |
Referenced by throttle_log().
#define IF_LOGLEVEL_AT | ( | _logLevel | ) | (g_platformProps.logLevel >= (_logLevel) ) |
#define IF_LOGLEVEL_DEBUG | ( | text | ) | do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) { text } } while(0) |
#define IF_LOGLEVEL_DEBUG_VERBOSE | ( | text | ) | do { } while(0) |
#define IF_LOGLEVEL_ERROR | ( | text | ) | do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) { text } } while(0) |
#define IF_LOGLEVEL_FATAL | ( | text | ) | do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) { text } } while(0) |
#define IF_LOGLEVEL_INFO | ( | text | ) | do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_INFO)) { text } } while(0) |
#define IF_LOGLEVEL_WARN | ( | text | ) | do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) { text } } while(0) |
#define LOG_ALWAYS | ( | fmt, | |
... | |||
) | do { log_out( 0, LOG_LEVEL_ALWAYS, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_CMD_BUF_SIZE 256 |
#define LOG_DEBUG | ( | fmt, | |
... | |||
) | do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) log_out( 0, LOG_LEVEL_DEBUG, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_DEBUG_VERBOSE | ( | fmt, | |
... | |||
) | do { } while(0) |
#define LOG_ERROR | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) log_out( 0, LOG_LEVEL_ERROR, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_FAST_ALWAYS | ( | fmt, | |
... | |||
) | do { log_out( 1, LOG_LEVEL_ALWAYS, (fmt), ##__VA_ARGS__ ); } while(0) |
Referenced by RiskCommon::loadSessionFilesForSearch().
#define LOG_FAST_DEBUG | ( | fmt, | |
... | |||
) | do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) log_out( 1, LOG_LEVEL_DEBUG, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_FAST_DEBUG_VERBOSE | ( | fmt, | |
... | |||
) | do { } while(0) |
#define LOG_FAST_ERROR | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) log_out( 1, LOG_LEVEL_ERROR, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_FAST_FATAL | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) log_out( 1, LOG_LEVEL_FATAL, (fmt), ##__VA_ARGS__ ); } while(0) |
Referenced by RiskCommon::findMessageInSessionByGlobID(), and RiskCommon::loadSessionFilesForSearch().
#define LOG_FAST_INFO | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_INFO) log_out( 1, LOG_LEVEL_INFO, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_FAST_ON_LEVEL | ( | _logLevel, | |
fmt, | |||
... | |||
) | do { if (g_platformProps.logLevel >= (_logLevel)) log_out( 1, (_logLevel), (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_FAST_WARN | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) log_out( 1, LOG_LEVEL_WARN, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_FATAL | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) log_out( 0, LOG_LEVEL_FATAL, (fmt), ##__VA_ARGS__ ); } while(0) |
Referenced by fifo_claim_continuous_space_for_push(), fifo_create(), and fifo_peek_continuous_buf().
#define LOG_INFO | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_INFO) log_out( 0, LOG_LEVEL_INFO, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_ON_LEVEL | ( | _logLevel, | |
fmt, | |||
... | |||
) | do { if (g_platformProps.logLevel >= (_logLevel)) log_out( 0, (_logLevel), (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_SK_ALWAYS | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { log_out( 0, LOG_LEVEL_ALWAYS, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_SK_DEBUG | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { if (unlikely(g_platformProps.logLevel >= LOG_LEVEL_DEBUG)) log_out( 0, LOG_LEVEL_DEBUG, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_SK_DEBUG_VERBOSE | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { } while(0) |
#define LOG_SK_ERROR | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_ERROR) log_out( 0, LOG_LEVEL_ERROR, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_SK_FATAL | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_FATAL) log_out( 0, LOG_LEVEL_FATAL, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_SK_INFO | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_INFO) log_out( 0, LOG_LEVEL_INFO, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_SK_WARN | ( | sessionID, | |
srv, | |||
sock, | |||
fmt, | |||
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) log_out( 0, LOG_LEVEL_WARN, (fmt), ##__VA_ARGS__ ); } while(0) |
#define LOG_WARN | ( | fmt, | |
... | |||
) | do { if (g_platformProps.logLevel >= LOG_LEVEL_WARN) log_out( 0, LOG_LEVEL_WARN, (fmt), ##__VA_ARGS__ ); } while(0) |
enum ThrottleLogCase |
__attribute__ | ( | (aligned(64)) | ) |
References atom_addrwide_read, atom_addrwide_t, atom_addrwide_write, atom_read, atom_t, atom_write, atomic_addrwide_bool_compare_swap, atomic_bool_compare_swap32, atomic_decr32, atomic_incr32, BARRIER, CACHEALIGN, CACHELINE_ALIGNED, CACHELINE_SIZE, cpu_relax, curr_, elems_, Utils::empty, init(), likely(), master_, object_pool(), reset(), and unlikely().
|
inlinestatic |
References atom_addrwide_read, atom_addrwide_write, and get_millisec().
Referenced by throttle_log().
V12_API void broadcast_log_to_tcp_clients | ( | char * | buf, |
int | len | ||
) |
V12_API void doLogOut | ( | enum PlatformLogLevel | logLevel, |
struct Server * | srv, | ||
char * | text, | ||
int | len | ||
) |
V12_API void initLogServer | ( | ) |
V12_API void initThreadLoggerClient | ( | ) |
V12_API void launch_logger_thread | ( | ) |
Starts the async logger thread.
int V12_API log_out | ( | int | fast, |
enum PlatformLogLevel | level, | ||
const char * | fmt, | ||
... | |||
) |
int V12_API int log_outh | ( | int | fast, |
enum PlatformLogLevel | level, | ||
const char * | header, | ||
int | header_len, | ||
const char * | fmt, | ||
... | |||
) |
int V12_API int void void V12_API void log_shell_read_input | ( | char * | data_buf, |
struct Socket * | sock, | ||
const char * | buf, | ||
int | len | ||
) |
V12_API char* printdata | ( | const char * | preambula, |
const char * | buffer, | ||
int | len, | ||
char * | printdata_buf, | ||
int | printdata_buf_len | ||
) |
V12_API void printdata_hex | ( | void * | data, |
unsigned int | len | ||
) |
void printUTCTimestampWithMs | ( | FILE * | f | ) |
V12_API void register_log_queue_client | ( | struct MessageQueue * | channel | ) |
int V12_API int void remote_alert | ( | char | severity, |
const char * | subject, | ||
const char * | fmt, | ||
... | |||
) |
int V12_API int void void remote_risk_alert | ( | char | severity, |
char | scope, | ||
int | rule, | ||
Account * | account, | ||
const char * | clordid, | ||
int | clordid_len, | ||
const char * | subject, | ||
const char * | fmt, | ||
... | |||
) |
V12_API void run_main_thread_shell | ( | ) |
V12_API void setLogLevel | ( | const char * | param, |
Utils::Log::LogCategory * | engineLog | ||
) |
|
inlinestatic |
References _throttle_log(), and DEF_LOG_THROTTLE_MILLIS.
int vlog_out | ( | int | fast, |
enum PlatformLogLevel | level, | ||
const char * | header, | ||
int | header_len, | ||
const char * | fmt, | ||
va_list | va, | ||
bool | writeToLog = true , |
||
Utils::RawBuffer * | appendToBuffer = NULL |
||
) |
void vremote_alert | ( | char | severity, |
const char * | subject, | ||
const char * | fmt, | ||
va_list | va | ||
) |
V12_API struct NetworkDeclaration LOGGER_NETWORK |
const char* logLevelNames[] |