iegomez / mosquitto-go-auth

Auth plugin for mosquitto.
MIT License
519 stars 170 forks source link

auth_opt_log_level does not work #273

Open eydonmlau opened 1 year ago

eydonmlau commented 1 year ago

Hi, When I set auth_opt_log_level in conf such like auth_opt_log_level debug, it doesn't work, it use the default info level. Is it need to add log.SetLevel(authPlugin.logLevel) at https://github.com/iegomez/mosquitto-go-auth/blob/9e9d90b676c97ec069bd39d96fa2235269f83932/go-auth.go#L86

iegomez commented 1 year ago

Yeah, that sounds like a regression when refactoring some backends to receive the log level. I don't have the time right now, but I'll look into fixing it when I do.

iegomez commented 1 year ago

@eydonmlau I checked and though the level is not set there, the logLevel option is passed to every backend initializer. Now, there are some odd things I found:

Now, I don't remember what was the rationale behind passing a level to each backend, maybe it had to do with tests or something like that. Since there's a single option, I don't see why we need it. But, as I said, it should still work so I'm curious what's your setup and which logs are you missing.