-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix LogLevels #9
Conversation
Good catch! I used the documentation in vosh_api.h to write and document the log levels, but I checked the code behind Would you mind reporting this also to upstream? It'd be good if they fixed the documentation also in the header file there. What I don't understand though, is the case of Java's bindings The enum has different values compared to those you propose, so I am not sure which ones it should be... We should probably just mimic the Severity enum but I still find it weird that the vosk team didnt do that. |
Ah, yeah, I never looked at the If you don't use the same values as the |
Now that I look closer at the Java enum and the docs for I'll still report upstream, though. No one benefits from this kind of sloppiness! |
Fair enough! When you report this to the vosk team, make sure to link this issue so they know the context. I'd rather wait to see if they clear things up, but otherwise this seems good to merge. |
Reported. Feel free to weigh in if you think anything I said is off. If the upstream follows my suggested resolution, there will be no effective change to their API, so this PR should still be roughly the right thing to do. One thing that I just learned, however, is that there are debug logs, but it doesn't look like they're part of the public API. There are values of at least |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Judging by what we talked here and the reply you got from the vosk team, I think this PR is indeed the way to go. If you don't have any other suggestions I'm happy to merge this.
Yeah I saw, rustfmt seems to work now, probably a github CI error, clippy shows some lints but that's okay, I'll fix them myself later. Merging now, thanks for the work!! |
Hello! I've been trying to use this library with suppressed logging for all but errors. I.e, in my program I had set:
Despite this setting, I was still getting warning messages, which were causing me some grief. Going to the Kaldi source, we can see that there's a misalignment between the
LogLevel
struct and the upstream understanding of log levels (perhaps due to upstream evolution over time). In particular, there's no such thing as aDebug
level (i.e. sending a value of1
is not meaningful), but there isWarn
level (-1
) before theError
level (-2
). This PR addresses this discrepancy.Now, this is a breaking change as we're redefining the contents of the
LogLevel
enum: adding a new level (Warn
), removingDebug
and renamingErrorInfo
to be simplyInfo
. Due to the mismatch of the enum to the upstream, I don't think there's a reasonable way of making this a non-breaking change.Not only is this a breaking change, but it's also altering the existing
LogLevel
naming convention. I'm open to changing this, butErrorInfoDebug
is an unusual name, differing from both Rust conventions for naming levels as well as the upstream Kaldi's conventions. The new names align with both of these standards.