Removed the debug tags from log entries in standard debug builds and added a special switch to the tests
This commit is contained in:
@ -675,7 +675,7 @@ static int logmanager_write_log(
|
|||||||
* Then print formatted string to write position.
|
* Then print formatted string to write position.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined (SS_DEBUG)
|
#if defined (SS_LOG_DEBUG)
|
||||||
{
|
{
|
||||||
|
|
||||||
char *copy,*tok;
|
char *copy,*tok;
|
||||||
@ -712,7 +712,7 @@ static int logmanager_write_log(
|
|||||||
flush);
|
flush);
|
||||||
|
|
||||||
|
|
||||||
#if defined (SS_DEBUG)
|
#if defined (SS_LOG_DEBUG)
|
||||||
{
|
{
|
||||||
sprintf(wp,"[msg:%d]",atomic_add(&write_index,1));
|
sprintf(wp,"[msg:%d]",atomic_add(&write_index,1));
|
||||||
safe_str_len -= strlen(wp);
|
safe_str_len -= strlen(wp);
|
||||||
@ -1104,7 +1104,7 @@ static blockbuf_t* blockbuf_init(
|
|||||||
bb->bb_buf_left = MAX_LOGSTRLEN;
|
bb->bb_buf_left = MAX_LOGSTRLEN;
|
||||||
bb->bb_buf_size = MAX_LOGSTRLEN;
|
bb->bb_buf_size = MAX_LOGSTRLEN;
|
||||||
|
|
||||||
#if defined(SS_DEBUG)
|
#if defined(SS_LOG_DEBUG)
|
||||||
sprintf(bb->bb_buf,"[block:%d]",atomic_add(&block_start_index,1));
|
sprintf(bb->bb_buf,"[block:%d]",atomic_add(&block_start_index,1));
|
||||||
bb->bb_buf_used += strlen(bb->bb_buf);
|
bb->bb_buf_used += strlen(bb->bb_buf);
|
||||||
bb->bb_buf_left -= strlen(bb->bb_buf);
|
bb->bb_buf_left -= strlen(bb->bb_buf);
|
||||||
@ -2484,7 +2484,7 @@ static void* thr_filewriter_fun(
|
|||||||
bb->bb_buf_used = 0;
|
bb->bb_buf_used = 0;
|
||||||
memset(bb->bb_buf, 0, bb->bb_buf_size);
|
memset(bb->bb_buf, 0, bb->bb_buf_size);
|
||||||
bb->bb_state = BB_CLEARED;
|
bb->bb_state = BB_CLEARED;
|
||||||
#if defined(SS_DEBUG)
|
#if defined(SS_LOG_DEBUG)
|
||||||
sprintf(bb->bb_buf,"[block:%d]",atomic_add(&block_start_index,1));
|
sprintf(bb->bb_buf,"[block:%d]",atomic_add(&block_start_index,1));
|
||||||
bb->bb_buf_used += strlen(bb->bb_buf);
|
bb->bb_buf_used += strlen(bb->bb_buf);
|
||||||
bb->bb_buf_left -= strlen(bb->bb_buf);
|
bb->bb_buf_left -= strlen(bb->bb_buf);
|
||||||
|
@ -8,6 +8,11 @@ SRCS := log_manager.cc
|
|||||||
UTILS_PATH := $(ROOT_PATH)/utils
|
UTILS_PATH := $(ROOT_PATH)/utils
|
||||||
CUR_DIR := $(shell pwd)
|
CUR_DIR := $(shell pwd)
|
||||||
|
|
||||||
|
ifeq ($(ADD_DEBUG_TAGS),Y)
|
||||||
|
CFLAGS += -DSS_LOG_DEBUG
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
makeall: clean all
|
makeall: clean all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -34,6 +34,7 @@ cleantests:
|
|||||||
- $(DEL) *~
|
- $(DEL) *~
|
||||||
|
|
||||||
buildtests:
|
buildtests:
|
||||||
|
$(MAKE) -C $(LOG_MANAGER_PATH) ADD_DEBUG_TAGS=Y
|
||||||
$(CC) $(CFLAGS) \
|
$(CC) $(CFLAGS) \
|
||||||
-L$(LOG_MANAGER_PATH) \
|
-L$(LOG_MANAGER_PATH) \
|
||||||
-Wl,-rpath,$(DEST)/lib \
|
-Wl,-rpath,$(DEST)/lib \
|
||||||
|
Reference in New Issue
Block a user