Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Println(v ...interface{}) Printf(format string, v ...interface{}) }
Logger interface allows implementations to provide to this package any object that implements the methods defined in it.
type NOOPLogger ¶
type NOOPLogger struct{}
NOOPLogger implements the logger that does not perform any operation by default. This allows us to efficiently discard the unwanted messages.
func (NOOPLogger) Printf ¶
func (NOOPLogger) Printf(format string, v ...interface{})
Printf is the library provided NOOPLogger's implementation of the required interface function(){}
func (NOOPLogger) Println ¶
func (NOOPLogger) Println(v ...interface{})
Println is the library provided NOOPLogger's implementation of the required interface function()
type TestLog ¶
The TestLog type is an adapter to allow the use of testing.T as a paho.Logger. With this implementation, log messages will only be output when a test fails (and will be associated with the test).
func NewTestLogger ¶
NewTestLogger accepts a testLogger (e.g. Testing.T) and a prefix (added to messages logged) and returns a Logger