-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlogger.go
38 lines (32 loc) · 1.19 KB
/
logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2020 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0
//
// SPDX-License-Identifier: EPL-2.0
package ditto
type (
// Logger interface allows plugging of a logger implementation that
// fits best the needs of the application that is to use the Ditto library.
Logger interface {
Println(v ...interface{})
Printf(format string, v ...interface{})
}
// LoggerStub provides an empty default implementation.
LoggerStub struct{}
)
// Println provides an empty default implementation for logging.
func (LoggerStub) Println(v ...interface{}) {}
// Printf provides an empty default implementation for formatted logging.
func (LoggerStub) Printf(format string, v ...interface{}) {}
// Levels of the library's output that can be configured during package initialization in init().
var (
INFO Logger = LoggerStub{}
WARN Logger = LoggerStub{}
DEBUG Logger = LoggerStub{}
ERROR Logger = LoggerStub{}
)