-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logging to constructor and enforcer (#10)
* Added logging to constructor and enforcer * Changes from code review * Added log level * Added nil logger check
- Loading branch information
1 parent
f2c8d76
commit 458a66d
Showing
5 changed files
with
83 additions
and
351 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
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,26 @@ | ||
package bascule | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/go-kit/kit/log" | ||
) | ||
|
||
var ( | ||
defaultLogger = log.NewNopLogger() | ||
|
||
ErrorKey interface{} = "error" | ||
) | ||
|
||
// logger we expect for the decorators | ||
type Logger interface { | ||
Log(keyvals ...interface{}) error | ||
} | ||
|
||
func NewDefaultLogger() Logger { | ||
return defaultLogger | ||
} | ||
|
||
func GetDefaultLoggerFunc(ctx context.Context) Logger { | ||
return NewDefaultLogger() | ||
} |
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
Oops, something went wrong.