k2-fsa / sherpa-onnx

Speech-to-text, text-to-speech, and speaker recognition using next-gen Kaldi with onnxruntime without Internet connection. Support embedded systems, Android, iOS, Raspberry Pi, RISC-V, x86_64 servers, websocket server/client, C/C++, Python, Kotlin, C#, Go, NodeJS, Java, Swift, Dart, JavaScript, Flutter

Home Page:https://k2-fsa.github.io/sherpa/onnx/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runtime option to disable sherpa logs

manickavela29 opened this issue · comments

Currently sherpa logs are controlled at 2 levels

  1. Build time with SHERPA_ONNX_ENABLE_CHECK option
  2. Runtime with SHERPA_ONNX_LOG_LEVEL env variable

But there is no control at runtime logs to disable,
will be handy in controlling at runtime.

will send a PR for this, let me know your thoughts
cc: @csukuangfj , @pkufool

Also adding SHERPA_ONNX_ENABLE_CHECK flag as part of the build tests might be necessary,
so that code bugs such as this #870 isn't missed.

I know that it is necessary for all the builds, but I have only tested for linux,
if its good I will send a PR changing all the workflows or it can just be related to linux builds

We are switching to

#define SHERPA_ONNX_LOGE(...) \

https://github.com/k2-fsa/sherpa-onnx/blob/master/sherpa-onnx/csrc/log.h
is intended to be removed.


If you want to disable all logs, just use

#define SHERPA_ONNX_LOGE(...)