Removed the debug tags from log entries in standard debug builds and added a special switch to the tests

This commit is contained in:
Markus Makela 2014-09-10 12:58:11 +03:00
parent f0bed1a8cc
commit aceae1c32b
3 changed files with 10 additions and 4 deletions

View File

@ -675,7 +675,7 @@ static int logmanager_write_log(
* Then print formatted string to write position.
*/
#if defined (SS_DEBUG)
#if defined (SS_LOG_DEBUG)
{
char *copy,*tok;
@ -712,7 +712,7 @@ static int logmanager_write_log(
flush);
#if defined (SS_DEBUG)
#if defined (SS_LOG_DEBUG)
{
sprintf(wp,"[msg:%d]",atomic_add(&write_index,1));
safe_str_len -= strlen(wp);
@ -1104,7 +1104,7 @@ static blockbuf_t* blockbuf_init(
bb->bb_buf_left = 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));
bb->bb_buf_used += 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;
memset(bb->bb_buf, 0, bb->bb_buf_size);
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));
bb->bb_buf_used += strlen(bb->bb_buf);
bb->bb_buf_left -= strlen(bb->bb_buf);

View File

@ -8,6 +8,11 @@ SRCS := log_manager.cc
UTILS_PATH := $(ROOT_PATH)/utils
CUR_DIR := $(shell pwd)
ifeq ($(ADD_DEBUG_TAGS),Y)
CFLAGS += -DSS_LOG_DEBUG
endif
makeall: clean all
clean:

View File

@ -34,6 +34,7 @@ cleantests:
- $(DEL) *~
buildtests:
$(MAKE) -C $(LOG_MANAGER_PATH) ADD_DEBUG_TAGS=Y
$(CC) $(CFLAGS) \
-L$(LOG_MANAGER_PATH) \
-Wl,-rpath,$(DEST)/lib \