RDK Documentation (Open Sourced RDK Components)
rdk_debug_priv.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "rdk_logger_types.h"
#include "rdk_error.h"
#include "rdk_debug_priv.h"
#include "rdk_dynamic_logger.h"
#include "log4c.h"
#include <rdk_utils.h>
Include dependency graph for rdk_debug_priv.c:

Go to the source code of this file.

Macros

#define RDK_DEBUG_DEFINE_STRINGS
 
#define WANT_LOG(mod, lvl)   ( ( ((mod) >= 0) && ((mod) < RDK_MAX_MOD_COUNT) ) ? (rdk_g_logControlTbl[(mod)] & (1 << (lvl))) : 0 )
 
#define SKIPWHITE(cptr)   while ((*cptr != '\0') && isspace(*cptr)) cptr++
 
#define LOG_TRACE
 
#define LOG_ALL
 
#define LOG_NONE   0
 
#define HOSTADDR_STR_MAX   255
 
#define MAX_LOGLINE_LENGTH   4096
 
#define COMCAST_DATAED_BUFF_SIZE   40
 

Enumerations

enum  
 
enum  
 

Functions

static int initLogger (char *category)
 
static const char * dated_format_nocr (const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
 
static const char * basic_format_nocr (const log4c_layout_t *a_layout, const log4c_logging_event_t *a_event)
 
static const char * comcast_dated_format_nocr (const log4c_layout_t *a_layout, log4c_logging_event_t *a_event)
 
static int stream_env_overwrite_open (log4c_appender_t *appender)
 
static int stream_env_append_open (log4c_appender_t *appender)
 
static int stream_env_append (log4c_appender_t *appender, const log4c_logging_event_t *event)
 
static int stream_env_plus_stdout_append (log4c_appender_t *appender, const log4c_logging_event_t *event)
 
static int stream_env_close (log4c_appender_t *appender)
 
void rdk_dbg_priv_Init ()
 
static void forceUpperCase (char *token)
 
static int logNameToEnum (const char *name)
 
static void extractToken (const char **srcStr, char *tokBuf)
 
static int parseLogConfig (const char *cfgStr, uint32_t *configEntry, const char **msg)
 
static void printTime (const struct tm *pTm, char *pBuff)
 
void rdk_dbg_priv_LogControlInit (void)
 
rdk_logger_Bool rdk_dbg_enabled (const char *module, rdk_LogLevel level)
 Function to check if a specific log level of a module is enabled. More...
 
void rdk_dbg_priv_SetLogLevelString (const char *pszModuleName, const char *pszLogLevels)
 
const char * rdk_dbg_priv_LogQueryOpSysIntf (char *modName, char *cfgStr, int cfgStrMaxLen)
 
void rdk_debug_priv_log_msg (rdk_LogLevel level, int module, const char *module_name, const char *format, va_list args)
 
void RDK_LOG_ControlCB (const char *moduleName, const char *subComponentName, const char *loggingLevel, int log_status)
 
static int stream_env_open (log4c_appender_t *appender, int append)
 

Variables

static int g_debugEnabled = 1
 Debugging messages are enabled. Default is enabled (1) and 0 for off.
 
int global_count
 
static rdk_logger_Bool g_initialized = FALSE
 
uint32_t rdk_g_logControlTbl [RDK_MAX_MOD_COUNT]
 
rdk_logger_Bool dbg_logViaUDP = FALSE
 
int dbg_udpSocket
 
struct sockaddr_in dbg_logHostAddr
 
log4c_category_t * stackCat = NULL
 
static const char * errorMsgs []
 
static log4c_category_t * defaultCategory = NULL
 
static log4c_category_t * glibCategory = NULL
 
static const log4c_layout_type_t log4c_layout_type_dated_nocr
 
static const log4c_layout_type_t log4c_layout_type_basic_nocr
 
static const log4c_layout_type_t log4c_layout_type_comcast_dated_nocr
 
static const log4c_appender_type_t log4c_appender_type_stream_env
 
static const log4c_appender_type_t log4c_appender_type_stream_env_append
 
static const log4c_appender_type_t log4c_appender_type_stream_env_plus_stdout
 
static const log4c_appender_type_t log4c_appender_type_stream_env_append_plus_stdout