mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 08:13:28 +03:00
Persist offline mqtt events in the queueDir and replay (#7037)
This commit is contained in:
committed by
Harshavardhana
parent
8757c963ba
commit
6571641735
+18
-14
@@ -14,23 +14,27 @@
|
||||
|
||||
package mqtt
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
type (
|
||||
// Logger interface allows implementations to provide to this package any
|
||||
// object that implements the methods defined in it.
|
||||
Logger interface {
|
||||
Println(v ...interface{})
|
||||
Printf(format string, v ...interface{})
|
||||
}
|
||||
|
||||
// NOOPLogger implements the logger that does not perform any operation
|
||||
// by default. This allows us to efficiently discard the unwanted messages.
|
||||
NOOPLogger struct{}
|
||||
)
|
||||
|
||||
func (NOOPLogger) Println(v ...interface{}) {}
|
||||
func (NOOPLogger) Printf(format string, v ...interface{}) {}
|
||||
|
||||
// Internal levels of library output that are initialised to not print
|
||||
// anything but can be overridden by programmer
|
||||
var (
|
||||
ERROR *log.Logger
|
||||
CRITICAL *log.Logger
|
||||
WARN *log.Logger
|
||||
DEBUG *log.Logger
|
||||
ERROR Logger = NOOPLogger{}
|
||||
CRITICAL Logger = NOOPLogger{}
|
||||
WARN Logger = NOOPLogger{}
|
||||
DEBUG Logger = NOOPLogger{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
ERROR = log.New(ioutil.Discard, "", 0)
|
||||
CRITICAL = log.New(ioutil.Discard, "", 0)
|
||||
WARN = log.New(ioutil.Discard, "", 0)
|
||||
DEBUG = log.New(ioutil.Discard, "", 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user