12

E_INFO is printing a bunch of logs. I don't know how I can turn that off. I searched E_INFO from all source files in pocket/base sphinx but I was not able to find where it set up the flag.

barryhunter
  • 20,886
  • 3
  • 30
  • 43
codereviewanskquestions
  • 13,460
  • 29
  • 98
  • 167

4 Answers4

12

Configuration option

-logfn /dev/null

Windows

-logfn nul

turns off logging.

If you are using API you can also use

err_set_logfile(char *filename)
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • Is there a way to turn it off for the pre-built pocketsphinx, ie in Java at runtime? I tried not to make setRawLogDir call - that didn't help. – Yevgeniy Sep 02 '14 at 18:30
  • 1
    Sorry, Yevgeniy, I'm not sure what your question is about. If it's about Android, sphinxbase there uses standard android logging through logcat, it's a bit different thing. – Nikolay Shmyrev Sep 02 '14 at 18:38
  • It does. Isn't this page's issue about that? Either way, do you know of how I could disable these logs without going through Proguard (which will slow down my build process)? I need to remove these message in debug env – Yevgeniy Sep 03 '14 at 00:28
  • Yevgeniy, logcat messages could be just filtered out. If you want to completely remove messages from logcat you can edit pocketsphinx sources. I don't recommend you doing that though you'll met issues debugging your application in the future. – Nikolay Shmyrev Sep 03 '14 at 09:31
  • 1
    This worked.. For windows Users, use pocketsphinx_continuous -logfn NUL – Abhishek Deb Jan 06 '16 at 06:16
1

If you are using the API, this is what I did:

// turn off pocketsphinx output
err_set_logfp(NULL);
err_set_debug_level(0);

The API given by the accepted answer didn't work for me.

syb0rg
  • 8,057
  • 9
  • 41
  • 81
  • Unfortunately this did *not* work for me on Windows 10. I can't find an explicit version but comments suggest my source is younger than July 2015. And the accepted answer did not work either. – JimmyNJ Feb 03 '17 at 13:44
1

i use the API,and add

err_set_logfp(NULL);

before using

ps_init(config);

and it will work without any "INFO"log

1

In Python:

config = Decoder.default_config()
config.set_string('-logfn','nul')
user12989841
  • 301
  • 3
  • 3