Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec0af49
commit ca11385
Showing
2 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ocpp | ||
|
||
// Logger is the adapter interface that needs to be implemented, if the library should internally print logs. | ||
// | ||
// This allows to hook up your logger of choice. | ||
type Logger interface { | ||
Debug(args ...interface{}) | ||
Debugf(format string, args ...interface{}) | ||
Info(args ...interface{}) | ||
Infof(format string, args ...interface{}) | ||
Error(args ...interface{}) | ||
Errorf(format string, args ...interface{}) | ||
} | ||
|
||
// VoidLogger is an empty implementation of the Logger interface, which doesn't actually process any logs. | ||
// It may be used as a dummy implementation, if no logs should be visible. | ||
type VoidLogger struct{} | ||
|
||
func (l *VoidLogger) Debug(args ...interface{}) {} | ||
func (l *VoidLogger) Debugf(format string, args ...interface{}) {} | ||
func (l *VoidLogger) Info(args ...interface{}) {} | ||
func (l *VoidLogger) Infof(format string, args ...interface{}) {} | ||
func (l *VoidLogger) Error(args ...interface{}) {} | ||
func (l *VoidLogger) Errorf(format string, args ...interface{}) {} |