alphacep / alphacep/vosk-api

Misleading `vosk_set_log_level` documentation

Aperta
#1,616 1 commento 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
15.1k
Fork
1.8k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The verbosity of Kaldi's logging are governed by the value passed to `SetVerboseLevel`, which (to some degree) corresponds to the `Severity` enum [[source]](https://github.com/kaldi-asr/kaldi/blob/122a3f239ed2f24271eb61b9aa3060fa06b820ac/src/base/kaldi-error.h#L70-L79). The values are: -3 (assertion failed), -2 (error), -1 (warning), and 0 (info). Values greater than 0 _are_ used for debug messages, but there does not seem to be any documentation for this.

The `vosk_set_log_level` docs [state](https://github.com/alphacep/vosk-api/blob/master/src/vosk_api.h#L319C1-L326C4):
```
/** Set log level for Kaldi messages
*
* @param log_level the level
* 0 - default value to print info and error messages but no debug
* less than 0 - don't print info messages
* greater than 0 - more verbose mode
*/
```

It's explicit that this is just controlling Kaldi messages (true, given the [implementation](https://github.com/alphacep/vosk-api/blob/master/src/vosk_api.cc#L203)), but it does not mention that there are three levels below `info`. The `-1` warn level would be good to call out as separate from the error level.

The Java `LogLevel` [enum](https://github.com/alphacep/vosk-api/blob/master/java/lib/src/main/java/org/vosk/LogLevel.java#L3-L6) is similarly misleading, with no ability to restrict logging to just errors.

My suggestion for resolution: improve the documentation and add `ERROR` level to the Java enum.

This issue was first reported at the [rust bindings project](https://github.com/Bear-03/vosk-rs/pull/9).

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.