diff options
author | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-09-08 22:55:38 +0000 |
---|---|---|
committer | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-09-08 22:55:38 +0000 |
commit | 173bb8f0a69c6554d544c922621b7edf0fd6dc7d (patch) | |
tree | cd0536421cabfa9fcea1ec63f2bc5dc9bfe2aa19 /navit | |
parent | afb855f06797db3724aec676378a2cfdd62c5673 (diff) | |
download | navit-173bb8f0a69c6554d544c922621b7edf0fd6dc7d.tar.gz |
Fix:speech_cmdline:Improve debug messages, don't use level 0.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5635 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
-rw-r--r-- | navit/speech/cmdline/speech_cmdline.c | 11 | ||||
-rw-r--r-- | navit/util.c | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c index 2f1d1c933..c05d05524 100644 --- a/navit/speech/cmdline/speech_cmdline.c +++ b/navit/speech/cmdline/speech_cmdline.c @@ -63,6 +63,7 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco { GList *loop_samples=samples,*result=NULL,*recursion_result; int shortest_result_length=INT_MAX; + dbg(1,"searching samples for text: '%s'\n",text); while (loop_samples) { char *sample_name=loop_samples->data; int sample_name_len; @@ -76,6 +77,7 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco const char *remaining_text=text+sample_name_len; while (*remaining_text == ' ' || *remaining_text == ',') remaining_text++; + dbg(1,"sample '%s' matched; remaining text: '%s'\n",sample_name,remaining_text); if (*remaining_text) { recursion_result=speech_cmdline_search(samples, suffix_len, remaining_text, decode); if (recursion_result && g_list_length(recursion_result) < shortest_result_length) { @@ -84,6 +86,8 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco result=g_list_prepend(result, loop_samples->data); shortest_result_length=g_list_length(result); } else { + dbg(1,"no (shorter) result found for remaining text '%s', " + "trying next sample\n", remaining_text); g_list_free(recursion_result); } } else { @@ -135,12 +139,13 @@ speechd_say(struct speech_priv *this, const char *text) if (this->sample_dir && this->sample_suffix) { argl=speech_cmdline_search(this->samples, strlen(this->sample_suffix), text, !!(this->flags & 1)); + dbg(1,"For text: '%s', found %d samples.\n",text,g_list_length(argl)); samplesmode=1; listlen=g_list_length(argl); } else { listlen=1; } - dbg(0,"text '%s'\n",text); + dbg(1,"Speaking text '%s'\n",text); if(listlen>0) { int argc; char**argv; @@ -160,7 +165,7 @@ speechd_say(struct speech_priv *this, const char *text) while(l) { char *new_arg; new_arg=g_strdup_printf("%s/%s",this->sample_dir,(char *)l->data); - dbg(0,"new_arg %s\n",new_arg); + dbg(1,"new_arg %s\n",new_arg); argv[j++]=g_strdup_printf(cmdv[i],new_arg); g_free(new_arg); l=g_list_next(l); @@ -234,7 +239,7 @@ speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *paren int len=strlen(name); if (len > suffix_len) { if (!strcmp(name+len-suffix_len, this->sample_suffix)) { - dbg(0,"found %s\n",name); + dbg(1,"found %s\n",name); this->samples=g_list_prepend(this->samples, g_strdup(name)); } } diff --git a/navit/util.c b/navit/util.c index bdf0aa61b..10cfc8386 100644 --- a/navit/util.c +++ b/navit/util.c @@ -511,6 +511,7 @@ spawn_process(char **argv) pid_t pid; sigset_t set, old; + dbg(1,"spawning process for '%s'\n", argv[0]); sigemptyset(&set); sigaddset(&set,SIGCHLD); spawn_process_sigmask(SIG_BLOCK,&set,&old); |