Permalink
Browse files

Remove debug level, people confuse it with log level

git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/sphinxbase@13272 94700074-3cef-4d97-a70e-9c8c206c02f5
  • Loading branch information...
nshmyrev
nshmyrev committed Jun 17, 2017
1 parent 27a98f9 commit 69c473ca648b8e2f8e453f27a405107a245bbcdd
View
@@ -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
View
@@ -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
@@ -15,6 +15,3 @@
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* Enable debugging output */
/* #undef SPHINX_DEBUG */
View
@@ -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 {
@@ -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
@@ -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... */
@@ -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;
}
@@ -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
@@ -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)
{
@@ -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;
}
@@ -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 }
};
@@ -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) {

0 comments on commit 69c473c

Please sign in to comment.