alphacep / alphacep/vosk-api

Misleading `vosk_set_log_level` documentation

Ouverte
#1,616 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
15.1k
Forks
1.8k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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).

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.