I am using MQTT paho library that has its own logger interface that is implemented by logrus logger, paho library has multiple levels: ERROR, CRITICAL and so on. I tried to do something like this:
MQTT.ERROR = app.Log.WithField("level","ERROR")
MQTT.CRITICAL = app.Log.WithField("level","CRITICAL")
but that does not log because you can not have a field named level, and if you do not add level, it always goes to info level because entry.Print is implementation that does log.Info inside, is there a way to pass a pointer to logrus logger with corresponding log level without making a new wrapper around it.
I know that it can be done with new package that will implement mqtt.Logger with functions that will have log.Error calls inside. But I feel that there should be a bit better way of doing this.