Commit 24d30ae7 authored by Laurent THOMAS's avatar Laurent THOMAS

log module improvement: remove redundant declarations y using C macro, remove...

log module improvement: remove redundant declarations y using C macro, remove unused variables, remove unused log components, move information to smaller visibility
parent bc6d1ad4
This diff is collapsed.
...@@ -85,31 +85,6 @@ extern "C" { ...@@ -85,31 +85,6 @@ extern "C" {
#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/ #define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/
/** @}*/ /** @}*/
/** @defgroup _log_format Defined log format
* @ingroup _macro
* @brief Macro of log formats defined by LOG
* @{*/
/* .log_format = 0x13 uncolored standard messages
* .log_format = 0x93 colored standard messages */
/* keep white space in first position; switching it to 0 allows colors to be disabled*/
#define LOG_RED "\033[1;31m" /*!< \brief VT100 sequence for bold red foreground */
#define LOG_GREEN "\033[32m" /*!< \brief VT100 sequence for green foreground */
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
#define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */
#define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */
#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */
#define FLAG_NOCOLOR 0x0001 /*!< \brief use colors in log messages, depending on level */
#define FLAG_THREAD 0x0008 /*!< \brief display thread name in log messages */
#define FLAG_LEVEL 0x0010 /*!< \brief display log level in log messages */
#define FLAG_FUNCT 0x0020
#define FLAG_FILE_LINE 0x0040
#define FLAG_TIME 0x0100
#define FLAG_THREAD_ID 0x0200
#define FLAG_REAL_TIME 0x0400
#define FLAG_INITIALIZED 0x8000
/** @}*/
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O) #define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O)) #define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
...@@ -138,92 +113,73 @@ extern "C" { ...@@ -138,92 +113,73 @@ extern "C" {
#define DEBUG_DLSCH_DECOD (1<<14) #define DEBUG_DLSCH_DECOD (1<<14)
#define UE_TIMING (1<<20) #define UE_TIMING (1<<20)
#define LOG_MASKMAP_INIT {\
{"PRACH", DEBUG_PRACH},\
{"RU", DEBUG_RU},\
{"UE_PHYPROC", DEBUG_UE_PHYPROC},\
{"LTEESTIM", DEBUG_LTEESTIM},\
{"DLCELLSPEC", DEBUG_DLCELLSPEC},\
{"ULSCH", DEBUG_ULSCH},\
{"RRC", DEBUG_RRC},\
{"PDCP", DEBUG_PDCP},\
{"DFT", DEBUG_DFT},\
{"ASN1", DEBUG_ASN1},\
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},\
{"UE_TIMING", UE_TIMING},\
{NULL,-1}\
}
#define SET_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask | B) #define SET_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask | B)
#define CLEAR_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask & (~B)) #define CLEAR_LOG_DEBUG(B) g_log->debug_mask = (g_log->debug_mask & (~B))
#define SET_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask | B) #define SET_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask | B)
#define CLEAR_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask & (~B)) #define CLEAR_LOG_DUMP(B) g_log->dump_mask = (g_log->dump_mask & (~B))
typedef enum { #define FOREACH_COMP(COMP_DEF) \
MIN_LOG_COMPONENTS = 0, COMP_DEF(PHY, log) \
PHY = MIN_LOG_COMPONENTS, COMP_DEF(MAC, log) \
MAC, COMP_DEF(EMU, log) \
EMU, COMP_DEF(SIM, txt) \
SIM, COMP_DEF(OMG, csv) \
OMG, COMP_DEF(OPT, log) \
OPT, COMP_DEF(OTG, log) \
OTG, COMP_DEF(OTG_LATENCY, dat) \
OTG_LATENCY, COMP_DEF(OTG_LATENCY_BG, dat) \
OTG_LATENCY_BG, COMP_DEF(OTG_GP, dat) \
OTG_GP, COMP_DEF(OTG_GP_BG, dat) \
OTG_GP_BG, COMP_DEF(OTG_JITTER, dat) \
OTG_JITTER, COMP_DEF(RLC, ) \
RLC, COMP_DEF(PDCP, ) \
PDCP, COMP_DEF(RRC, ) \
RRC, COMP_DEF(NAS, log) \
NAS, COMP_DEF(OIP, ) \
PERF, COMP_DEF(CLI, ) \
OIP, COMP_DEF(OCM, ) \
CLI, COMP_DEF(GTPU, ) \
OCM, COMP_DEF(SDAP, ) \
UDP_, COMP_DEF(SPGW, ) \
GTPU, COMP_DEF(S1AP, ) \
SDAP, COMP_DEF(F1AP, ) \
SPGW, COMP_DEF(E1AP, ) \
S1AP, COMP_DEF(SCTP, ) \
F1AP, COMP_DEF(HW, ) \
E1AP, COMP_DEF(OSA, ) \
SCTP, COMP_DEF(ENB_APP, log) \
HW, COMP_DEF(MCE_APP, log) \
OSA, COMP_DEF(MME_APP, log) \
RAL_ENB, COMP_DEF(TMR, ) \
RAL_UE, COMP_DEF(USIM, log) \
ENB_APP, COMP_DEF(F1U, ) \
MCE_APP, COMP_DEF(X2AP, ) \
MME_APP, COMP_DEF(M2AP, ) \
TMR, COMP_DEF(M3AP, ) \
USIM, COMP_DEF(NGAP, ) \
LOCALIZE, COMP_DEF(GNB_APP, log) \
F1U, COMP_DEF(NR_RRC, log) \
X2AP, COMP_DEF(NR_MAC, log) \
M2AP, COMP_DEF(NR_MAC_DCI, log) \
M3AP, COMP_DEF(NR_PHY_DCI, log) \
NGAP, COMP_DEF(NR_PHY, log) \
GNB_APP, COMP_DEF(LOADER, log) \
NR_RRC, COMP_DEF(ASN1, log) \
NR_MAC, COMP_DEF(NFAPI_VNF, log) \
NR_MAC_DCI, COMP_DEF(NFAPI_PNF, log) \
NR_PHY_DCI, COMP_DEF(ITTI, log) \
NR_PHY, COMP_DEF(UTIL, log) \
LOADER, COMP_DEF(MAX_LOG_PREDEF_COMPONENTS, )
ASN1,
NFAPI_VNF, #define COMP_ENUM(comp, file_extension) comp,
NFAPI_PNF, typedef enum { FOREACH_COMP(COMP_ENUM) } comp_name_t;
ITTI,
UTIL, #define COMP_TEXT(comp, file_extension) #comp,
MAX_LOG_PREDEF_COMPONENTS, static const char *const comp_name[] = {FOREACH_COMP(COMP_TEXT)};
} comp_name_t;
#define COMP_EXTENSION(comp, file_extension) #file_extension,
static const char *const comp_extension[] = {FOREACH_COMP(COMP_EXTENSION)};
#define MAX_LOG_DYNALLOC_COMPONENTS 20 #define MAX_LOG_DYNALLOC_COMPONENTS 20
#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS) #define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS)
...@@ -282,6 +238,9 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char ...@@ -282,6 +238,9 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
int set_log(int component, int level); int set_log(int component, int level);
void set_glog(int level); void set_glog(int level);
mapping * log_level_names_ptr(void);
mapping * log_option_names_ptr(void);
mapping * log_maskmap_ptr(void);
void set_glog_onlinelog(int enable); void set_glog_onlinelog(int enable);
void set_glog_filelog(int enable); void set_glog_filelog(int enable);
void set_component_filelog(int comp); void set_component_filelog(int comp);
...@@ -290,9 +249,8 @@ void set_component_consolelog(int comp); ...@@ -290,9 +249,8 @@ void set_component_consolelog(int comp);
int map_str_to_int(const mapping *map, const char *str); int map_str_to_int(const mapping *map, const char *str);
char *map_int_to_str(const mapping *map, const int val); char *map_int_to_str(const mapping *map, const int val);
void logClean (void); void logClean (void);
int is_newline( char *str, int size);
int register_log_component(char *name, char *fext, int compidx); int register_log_component(const char *name, const char *fext, int compidx);
int logInit_log_mem(char*); int logInit_log_mem(char*);
void close_log_mem(void); void close_log_mem(void);
......
...@@ -256,6 +256,9 @@ void print_threads(char *buf, int debug, telnet_printfunc_t prnt) ...@@ -256,6 +256,9 @@ void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt) int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt)
{ {
webdatadef_t *logsdata = (webdatadef_t *)data; webdatadef_t *logsdata = (webdatadef_t *)data;
const mapping *const log_level_names = log_level_names_ptr();
const mapping *const log_options = log_option_names_ptr();
const mapping *log_maskmap = log_maskmap_ptr();
if (strncmp(cmdbuff, "set", 3) == 0) { if (strncmp(cmdbuff, "set", 3) == 0) {
telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf; telnet_printfunc_t printfunc = (prnt != NULL) ? prnt : (telnet_printfunc_t)printf;
if (strcasestr(cmdbuff, "loglvl") != NULL) { if (strcasestr(cmdbuff, "loglvl") != NULL) {
...@@ -274,7 +277,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -274,7 +277,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
logsdata->lines[0].val[0], logsdata->lines[0].val[0],
logsdata->lines[0].val[1], logsdata->lines[0].val[1],
enabled ? "enabled" : "disabled", enabled ? "enabled" : "disabled",
loginfile ? g_log->log_component[logsdata->numlines].filelog_name : "stdout"); loginfile ? g_log->log_rarely_used[logsdata->numlines].filelog_name : "stdout");
} }
if (strcasestr(cmdbuff, "logopt") != NULL) { if (strcasestr(cmdbuff, "logopt") != NULL) {
int optbit = map_str_to_int(log_options, logsdata->lines[0].val[0]); int optbit = map_str_to_int(log_options, logsdata->lines[0].val[0]);
...@@ -329,12 +332,14 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -329,12 +332,14 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
snprintf(logsdata->columns[3].coltitle, TELNET_CMD_MAXSIZE, "in file"); snprintf(logsdata->columns[3].coltitle, TELNET_CMD_MAXSIZE, "in file");
logsdata->columns[3].coltype = TELNET_CHECKVAL_BOOL; logsdata->columns[3].coltype = TELNET_CHECKVAL_BOOL;
for (int i = MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { for (int i = 0; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) { if (g_log->log_component[i].name != NULL) {
logsdata->numlines++; logsdata->numlines++;
logsdata->lines[i].val[0] = (char *)(g_log->log_component[i].name); logsdata->lines[i].val[0] = (char *)(g_log->log_component[i].name);
logsdata->lines[i].val[1] = map_int_to_str(log_level_names, (g_log->log_component[i].level >= 0) ? g_log->log_component[i].level : g_log->log_component[i].savedlevel); logsdata->lines[i].val[1] = map_int_to_str(
log_level_names,
(g_log->log_component[i].level >= 0) ? g_log->log_component[i].level : g_log->log_rarely_used[i].savedlevel);
logsdata->lines[i].val[2] = (g_log->log_component[i].level >= 0) ? "true" : "false"; logsdata->lines[i].val[2] = (g_log->log_component[i].level >= 0) ? "true" : "false";
logsdata->lines[i].val[3] = (g_log->log_component[i].filelog > 0) ? "true" : "false"; logsdata->lines[i].val[3] = (g_log->log_component[i].filelog > 0) ? "true" : "false";
} }
...@@ -353,7 +358,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -353,7 +358,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
for (int i = 0; log_maskmap[i].name != NULL; i++) { for (int i = 0; log_maskmap[i].name != NULL; i++) {
logsdata->numlines++; logsdata->numlines++;
logsdata->lines[i].val[0] = log_maskmap[i].name; logsdata->lines[i].val[0] = (char *)log_maskmap[i].name;
logsdata->lines[i].val[1] = (g_log->debug_mask & log_maskmap[i].value) ? "true" : "false"; logsdata->lines[i].val[1] = (g_log->debug_mask & log_maskmap[i].value) ? "true" : "false";
logsdata->lines[i].val[2] = (g_log->dump_mask & log_maskmap[i].value) ? "true" : "false"; logsdata->lines[i].val[2] = (g_log->dump_mask & log_maskmap[i].value) ? "true" : "false";
} }
...@@ -370,7 +375,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun ...@@ -370,7 +375,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
for (int i = 0; log_options[i].name != NULL; i++) { for (int i = 0; log_options[i].name != NULL; i++) {
logsdata->numlines++; logsdata->numlines++;
logsdata->lines[i].val[0] = log_options[i].name; logsdata->lines[i].val[0] = (char *)log_options[i].name;
logsdata->lines[i].val[1] = (g_log->flag & log_options[i].value) ? "true" : "false"; logsdata->lines[i].val[1] = (g_log->flag & log_options[i].value) ? "true" : "false";
} }
} }
...@@ -395,17 +400,23 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) ...@@ -395,17 +400,23 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
} }
if (strcasestr(buf,"loglvl") != NULL) { if (strcasestr(buf,"loglvl") != NULL) {
prnt("\n component level enabled output\n"); prnt("\n component level enabled output\n");
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { const mapping *const log_level_names = log_level_names_ptr();
for (int i = 0; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) { if (g_log->log_component[i].name != NULL) {
prnt("%02i %17.17s:%10.10s %s %s\n",i ,g_log->log_component[i].name, prnt("%02i %17.17s:%10.10s %s %s\n",
map_int_to_str(log_level_names,(g_log->log_component[i].level>=0)?g_log->log_component[i].level:g_log->log_component[i].savedlevel), i,
((g_log->log_component[i].level>=0)?"Y":"N"), g_log->log_component[i].name,
((g_log->log_component[i].filelog>0)?g_log->log_component[i].filelog_name:"stdout")); map_int_to_str(
log_level_names,
(g_log->log_component[i].level >= 0) ? g_log->log_component[i].level : g_log->log_rarely_used[i].savedlevel),
((g_log->log_component[i].level >= 0) ? "Y" : "N"),
((g_log->log_component[i].filelog > 0) ? g_log->log_rarely_used[i].filelog_name : "stdout"));
} }
} }
} }
if (strcasestr(buf,"logopt") != NULL) { if (strcasestr(buf,"logopt") != NULL) {
prnt("\n option enabled\n"); prnt("\n option enabled\n");
const mapping *const log_options = log_option_names_ptr();
for (int i=0; log_options[i].name != NULL; i++) { for (int i=0; log_options[i].name != NULL; i++) {
prnt("%02i %17.17s %10.10s \n",i ,log_options[i].name, prnt("%02i %17.17s %10.10s \n",i ,log_options[i].name,
((g_log->flag & log_options[i].value)?"Y":"N") ); ((g_log->flag & log_options[i].value)?"Y":"N") );
...@@ -413,6 +424,7 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) ...@@ -413,6 +424,7 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
} }
if (strcasestr(buf,"dbgopt") != NULL) { if (strcasestr(buf,"dbgopt") != NULL) {
prnt("\n module debug dumpfile\n"); prnt("\n module debug dumpfile\n");
const mapping *log_maskmap = log_maskmap_ptr();
for (int i=0; log_maskmap[i].name != NULL ; i++) { for (int i=0; log_maskmap[i].name != NULL ; i++) {
prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name, prnt("%02i %17.17s %5.5s %5.5s\n",i ,log_maskmap[i].name,
((g_log->debug_mask & log_maskmap[i].value)?"Y":"N"), ((g_log->debug_mask & log_maskmap[i].value)?"Y":"N"),
...@@ -528,7 +540,9 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -528,7 +540,9 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
if (debug > 0) if (debug > 0)
prnt( "proccmd_log received %s\n s=%i sub command %s\n",buf,s,((logsubcmd==NULL)?"":logsubcmd)); prnt( "proccmd_log received %s\n s=%i sub command %s\n",buf,s,((logsubcmd==NULL)?"":logsubcmd));
const mapping *const log_level_names = log_level_names_ptr();
const mapping *const log_options = log_option_names_ptr();
const mapping *log_maskmap = log_maskmap_ptr();
if (s == 1 && logsubcmd != NULL) { if (s == 1 && logsubcmd != NULL) {
if (strcasestr(logsubcmd,"online") != NULL) { if (strcasestr(logsubcmd,"online") != NULL) {
if (strcasestr(buf,"noonline") != NULL) { if (strcasestr(buf,"noonline") != NULL) {
...@@ -541,20 +555,20 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -541,20 +555,20 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
} }
else if (strcasestr(logsubcmd,"show") != NULL) { else if (strcasestr(logsubcmd,"show") != NULL) {
prnt("Available log levels: \n "); prnt("Available log levels: \n ");
for (int i=0; log_level_names[i].name != NULL; i++) for (int i = 0; log_level_names[i].name != NULL; i++)
prnt("%s ",log_level_names[i].name); prnt("%s ", log_level_names[i].name);
prnt("\n\n"); prnt("\n\n");
prnt("Available display options: \n "); prnt("Available display options: \n ");
for (int i=0; log_options[i].name != NULL; i++) for (int i = 0; log_options[i].name != NULL; i++)
prnt("%s ",log_options[i].name); prnt("%s ", log_options[i].name);
prnt("\n\n"); prnt("\n\n");
prnt("Available debug and dump options: \n "); prnt("Available debug and dump options: \n ");
for (int i=0; log_maskmap[i].name != NULL; i++) for (int i = 0; log_maskmap[i].name != NULL; i++)
prnt("%s ",log_maskmap[i].name); prnt("%s ", log_maskmap[i].name);
prnt("\n\n"); prnt("\n\n");
proccmd_show("loglvl",debug,prnt); proccmd_show("loglvl", debug, prnt);
proccmd_show("logopt",debug,prnt); proccmd_show("logopt", debug, prnt);
proccmd_show("dbgopt",debug,prnt); proccmd_show("dbgopt", debug, prnt);
} }
else if (strcasestr(logsubcmd,"help") != NULL) { else if (strcasestr(logsubcmd,"help") != NULL) {
prnt(PROCCMD_LOG_HELP_STRING); prnt(PROCCMD_LOG_HELP_STRING);
...@@ -569,33 +583,33 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -569,33 +583,33 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
l=sscanf(logsubcmd,"%m[^'_']_%ms",&logparam,&opt); l=sscanf(logsubcmd,"%m[^'_']_%ms",&logparam,&opt);
if (l == 2 && strcmp(logparam,"print") == 0){ if (l == 2 && strcmp(logparam,"print") == 0){
optbit=map_str_to_int(log_options,opt); optbit = map_str_to_int(log_options, opt);
if (optbit < 0) { if (optbit < 0) {
prnt("option %s unknown\n",opt); prnt("option %s unknown\n", opt);
} else { } else {
if (idx1 > 0) if (idx1 > 0)
SET_LOG_OPTION(optbit); SET_LOG_OPTION(optbit);
else else
CLEAR_LOG_OPTION(optbit); CLEAR_LOG_OPTION(optbit);
proccmd_show("logopt",debug,prnt); proccmd_show("logopt", debug, prnt);
} }
} }
else if (l == 2 && strcmp(logparam,"debug") == 0){ else if (l == 2 && strcmp(logparam,"debug") == 0){
optbit=map_str_to_int(log_maskmap,opt); optbit = map_str_to_int(log_maskmap, opt);
if (optbit < 0) { if (optbit < 0) {
prnt("module %s unknown\n",opt); prnt("module %s unknown\n", opt);
} else { } else {
if (idx1 > 0) if (idx1 > 0)
SET_LOG_DEBUG(optbit); SET_LOG_DEBUG(optbit);
else else
CLEAR_LOG_DEBUG(optbit); CLEAR_LOG_DEBUG(optbit);
proccmd_show("dbgopt",debug,prnt); proccmd_show("dbgopt", debug, prnt);
} }
} }
else if (l == 2 && strcmp(logparam,"dump") == 0){ else if (l == 2 && strcmp(logparam,"dump") == 0){
optbit=map_str_to_int(log_maskmap,opt); optbit = map_str_to_int(log_maskmap, opt);
if (optbit < 0) { if (optbit < 0) {
prnt("module %s unknown\n",opt); prnt("module %s unknown\n", opt);
} else { } else {
if (idx1 > 0) if (idx1 > 0)
SET_LOG_DUMP(optbit); SET_LOG_DUMP(optbit);
...@@ -620,10 +634,10 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -620,10 +634,10 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
prnt("l=%i, %s %s\n",l,((logparam==NULL)?"\"\"":logparam), ((tmpstr==NULL)?"\"\"":tmpstr)); prnt("l=%i, %s %s\n",l,((logparam==NULL)?"\"\"":logparam), ((tmpstr==NULL)?"\"\"":tmpstr));
if (l ==2 ) { if (l ==2 ) {
if (strcmp(logparam,"level") == 0) { if (strcmp(logparam,"level") == 0) {
level=map_str_to_int(log_level_names,tmpstr); level = map_str_to_int(log_level_names, tmpstr);
if (level < 0) { if (level < 0) {
prnt("level %s unknown\n",tmpstr); prnt("level %s unknown\n", tmpstr);
level=OAILOG_DISABLE - 1; level = OAILOG_DISABLE - 1;
} }
} else { } else {
prnt("%s%s unknown log sub command \n",logparam, tmpstr); prnt("%s%s unknown log sub command \n",logparam, tmpstr);
...@@ -650,7 +664,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -650,7 +664,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
if (level >= OAILOG_DISABLE) if (level >= OAILOG_DISABLE)
set_log(i, level); set_log(i, level);
else if ( enable == 1) else if ( enable == 1)
set_log(i,g_log->log_component[i].savedlevel); set_log(i, g_log->log_rarely_used[i].savedlevel);
else if ( filelog == 1 ) { else if ( filelog == 1 ) {
set_component_filelog(i); set_component_filelog(i);
} else if ( filelog == 0 ) { } else if ( filelog == 0 ) {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*/ */
#include "pdcp_sequence_manager.h" #include "pdcp_sequence_manager.h"
#include "common/utils//LOG/log.h" #include "common/utils/LOG/log.h"
#include "pdcp_util.h" #include "pdcp_util.h"
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment