Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
Remove debug level, people confuse it with log level
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/sphinxbase@13272 94700074-3cef-4d97-a70e-9c8c206c02f5
  • Loading branch information
nshmyrev committed Jun 17, 2017
1 parent 27a98f9 commit 69c473c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 78 deletions.
9 changes: 0 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ else
fi])
AM_CONDITIONAL(FIXED_POINT, test x$fixed_point = xtrue)

dnl
dnl Enable debugging
dnl
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[Enable debugging output]),
AC_DEFINE(SPHINX_DEBUG, [],
[Enable debugging output]))

dnl
dnl determine audio type or use none if none supported on this platform
dnl
Expand Down
3 changes: 0 additions & 3 deletions include/android/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8

/* Enable debugging output */
/* #undef SPHINX_DEBUG */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

Expand Down
3 changes: 0 additions & 3 deletions include/android/sphinx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@

/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8

/* Enable debugging output */
/* #undef SPHINX_DEBUG */
37 changes: 3 additions & 34 deletions include/sphinxbase/err.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,12 @@ extern "C" {
#define E_INFO_NOFN(...) err_msg(ERR_INFO, NULL, 0, __VA_ARGS__)

/**
* Print debugging information to standard error stream.
*
* This will only print a message if:
* 1. Debugging is enabled at compile time
* 2. The debug level is greater than or equal to \a level
*
* Note that for portability reasons the format and arguments must be
* enclosed in an extra set of parentheses.
* Debug is disabled by default
*/
#ifdef SPHINX_DEBUG
#define E_DEBUG(level, ...) \
if (err_get_debug_level() >= level) \
err_msg(ERR_DEBUG, FILELINE, __VA_ARGS__)
#define E_DEBUGCONT(level, ...) \
if (err_get_debug_level() >= level) \
err_msg(ERR_DEBUG, NULL, 0, __VA_ARGS__)
#define E_DEBUG(...) err_msg(ERR_DEBUG, NULL, 0, __VA_ARGS__)
#else
#define E_DEBUG(level,x)
#define E_DEBUGCONT(level,x)
#define E_DEBUG(...)
#endif

typedef enum err_e {
Expand Down Expand Up @@ -205,24 +192,6 @@ err_get_logfp(void);
SPHINXBASE_EXPORT int
err_set_logfile(const char *path);

/**
* Set debugging verbosity level.
*
* Note that debugging messages are only enabled when compiled with -DDEBUG.
*
* @param level Verbosity level to set, or 0 to disable debug messages.
*/
SPHINXBASE_EXPORT
int err_set_debug_level(int level);

/**
* Get debugging verbosity level.
*
* Note that debugging messages are only enabled when compiled with -DDEBUG.
*/
SPHINXBASE_EXPORT
int err_get_debug_level(void);

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/libsphinxbase/lm/fsg_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ fsg_model_add_alt(fsg_model_t * fsg, char const *baseword,
bitvec_set(fsg->silwords, altwid);
}

E_DEBUG(2, ("Adding alternate word transitions (%s,%s) to FSG\n",
baseword, altword));
E_DEBUG("Adding alternate word transitions (%s,%s) to FSG\n",
baseword, altword);

/* Look for all transitions involving baseword and duplicate them. */
/* FIXME: This will also get slow, eventually... */
Expand Down Expand Up @@ -505,7 +505,7 @@ fsg_model_add_alt(fsg_model_t * fsg, char const *baseword,
}
}

E_DEBUG(2, ("Added %d alternate word transitions\n", ntrans));
E_DEBUG("Added %d alternate word transitions\n", ntrans);
return ntrans;
}

Expand Down
16 changes: 0 additions & 16 deletions src/libsphinxbase/util/err.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
static FILE* logfp = NULL;
static int logfp_disabled = FALSE;

static int sphinx_debug_level;

#if defined(__ANDROID__)
#include <android/log.h>
static void
Expand Down Expand Up @@ -276,20 +274,6 @@ err_get_logfp(void)
return logfp;
}

int
err_set_debug_level(int level)
{
int prev = sphinx_debug_level;
sphinx_debug_level = level;
return prev;
}

int
err_get_debug_level(void)
{
return sphinx_debug_level;
}

void
err_set_callback(err_cb_f cb, void* user_data)
{
Expand Down
4 changes: 2 additions & 2 deletions src/libsphinxbase/util/listelem_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ __listelem_malloc_id__(listelem_alloc_t *list, char *caller_file,
E_ERROR("Failed to find block index for pointer %p!\n", ptr);
}
ptridx = (ptr - block) / (list->elemsize / sizeof(*block));
E_DEBUG(4,("ptr %p block %p blkidx %d ptridx %d\n",
ptr, block, list->n_blocks - blkidx - 1, ptridx));
E_DEBUG("ptr %p block %p blkidx %d ptridx %d\n",
ptr, block, list->n_blocks - blkidx - 1, ptridx);
*out_id = ((list->n_blocks - blkidx - 1) << BLKID_SHIFT) | ptridx;
}

Expand Down
8 changes: 0 additions & 8 deletions src/sphinx_lmtools/sphinx_lm_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ static const arg_t defn[] = {
"no",
"Use memory-mapped I/O for reading binary LM files"},

{ "-debug",
ARG_INT32,
NULL,
"Verbosity level for debugging messages"
},

{ NULL, 0, NULL, NULL }
};

Expand Down Expand Up @@ -127,8 +121,6 @@ main(int argc, char *argv[])
usagemsg(argv[0]);
}

err_set_debug_level(cmd_ln_int32_r(config, "-debug"));

/* Create log math object. */
if ((lmath = logmath_init
(cmd_ln_float64_r(config, "-logbase"), 0, 0)) == NULL) {
Expand Down

0 comments on commit 69c473c

Please sign in to comment.