B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros | Enumerations | Functions | Variables
sockets_logging.h File Reference
#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>
+ Include dependency graph for sockets_logging.h:
+ This graph shows which files directly or indirectly include this file:

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)
 
void broadcast_log_to_tcp_clients (char *buf, int len)
 
void doLogOut (enum PlatformLogLevel logLevel, struct Server *srv, char *text, int len)
 
void dump_order_table ()
 
void dump_workbook ()
 
void initGlobalLogger ()
 
void initGlobalLogger_linuxProxy ()
 
void initLogServer ()
 
void initThreadLoggerClient ()
 
void launch_globlogger_thread ()
 
void launch_logger_thread ()
 Starts the async logger thread. More...
 
int log_out (int fast, enum PlatformLogLevel level, const char *fmt,...) __attribute__((format(printf
 
int int log_outh (int fast, enum PlatformLogLevel level, const char *header, int header_len, const char *fmt,...) __attribute__((format(printf
 
void log_shell_greeting (struct Socket *sock)
 
int int void void void log_shell_read_input (char *data_buf, struct Socket *sock, const char *buf, int len)
 
char * printdata (const char *preambula, const char *buffer, int len, char *printdata_buf, int printdata_buf_len)
 
void printdata_hex (void *data, unsigned int len)
 
void printUTCTimestampWithMs (FILE *f)
 
void prompt (struct Socket *sock)
 
void register_log_input_queue_client (struct Fifo *channel)
 
void register_log_queue_client (struct MessageQueue *channel)
 
int int void remote_alert (char severity, const char *subject, const char *fmt,...) __attribute__((format(printf
 
int 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
 
void run_main_thread_shell ()
 
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)
 
void writeToSocket (struct Socket *sock, const char *str)
 

Variables

struct NetworkDeclaration LOGGER_NETWORK
 
const char * logLevelNames []
 

Macro Definition Documentation

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

Enumeration Type Documentation

Enumerator
LOG_DROPCOPY_FULL 
LOG_HASH_FULL 
LOG_ORDER_TABLE_STATS 
LOG_ROUTE_QUEUE 
LAST_ThrottleLogCase 

Function Documentation

__attribute__ ( (aligned(64))  )
static int _throttle_log ( enum ThrottleLogCase  caseNum,
int  rate_ctl_millis 
)
inlinestatic
void broadcast_log_to_tcp_clients ( char *  buf,
int  len 
)
void doLogOut ( enum PlatformLogLevel  logLevel,
struct Server srv,
char *  text,
int  len 
)
void dump_order_table ( )
void dump_workbook ( )
void initGlobalLogger ( )
void initGlobalLogger_linuxProxy ( )
void initLogServer ( )
void initThreadLoggerClient ( )
void launch_globlogger_thread ( )
void launch_logger_thread ( )

Starts the async logger thread.

See Also
initDone_LoggerThread()
int log_out ( int  fast,
enum PlatformLogLevel  level,
const char *  fmt,
  ... 
)
int int log_outh ( int  fast,
enum PlatformLogLevel  level,
const char *  header,
int  header_len,
const char *  fmt,
  ... 
)
void log_shell_greeting ( struct Socket sock)
int int void void void log_shell_read_input ( char *  data_buf,
struct Socket sock,
const char *  buf,
int  len 
)
char* printdata ( const char *  preambula,
const char *  buffer,
int  len,
char *  printdata_buf,
int  printdata_buf_len 
)
void printdata_hex ( void *  data,
unsigned int  len 
)
void printUTCTimestampWithMs ( FILE *  f)
void prompt ( struct Socket sock)
void register_log_input_queue_client ( struct Fifo channel)
void register_log_queue_client ( struct MessageQueue channel)
int int void remote_alert ( char  severity,
const char *  subject,
const char *  fmt,
  ... 
)
int 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,
  ... 
)
void run_main_thread_shell ( )
void setLogLevel ( const char *  param,
Utils::Log::LogCategory engineLog 
)
static int throttle_log ( enum ThrottleLogCase  caseNum)
inlinestatic
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 
)
void writeToSocket ( struct Socket sock,
const char *  str 
)

Variable Documentation

struct NetworkDeclaration LOGGER_NETWORK
const char* logLevelNames[]