-
Notifications
You must be signed in to change notification settings - Fork 0
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
ivanglie
committed
May 21, 2022
1 parent
f5d8e5a
commit 1277ce2
Showing
3 changed files
with
32 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
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 coingate | ||
|
||
import ( | ||
"errors" | ||
stdlog "log" | ||
"os" | ||
) | ||
|
||
// Logger is an interface that represents the required methods to log data. | ||
type Logger interface { | ||
Println(v ...interface{}) | ||
Printf(format string, v ...interface{}) | ||
} | ||
|
||
var log Logger = stdlog.New(os.Stderr, "", stdlog.LstdFlags) | ||
|
||
// SetLogger specifies the logger that the package should use. | ||
func SetLogger(logger Logger) error { | ||
if logger == nil { | ||
return errors.New("logger is nil") | ||
} | ||
log = logger | ||
return nil | ||
} |