-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat: add logger interface (#17)"
This reverts commit bb5f31e.
- Loading branch information
1 parent
bb5f31e
commit 0cee5e3
Showing
12 changed files
with
85 additions
and
104 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package transfer | ||
|
||
// Logger is a logging interface. | ||
type Logger interface { | ||
// Log logs the given message and structured arguments. | ||
Log(msg string, kv ...interface{}) | ||
} | ||
import ( | ||
"github.com/rubyist/tracerx" | ||
) | ||
|
||
type noopLogger struct{} | ||
var ( | ||
// Debug is the debug flag. | ||
Debug = false | ||
) | ||
|
||
var _ Logger = (*noopLogger)(nil) | ||
// Log logs the given arguments if Debug is true. | ||
func Log(v ...interface{}) { | ||
tracerx.Printf("%v", v...) | ||
} | ||
|
||
// Log implements Logger. | ||
func (*noopLogger) Log(string, ...interface{}) {} | ||
// Logf logs the given arguments if Debug is true. | ||
func Logf(format string, v ...interface{}) { | ||
tracerx.Printf(format, v...) | ||
} |
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
Oops, something went wrong.