forked from crewjam/saml
-
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.
Use interface for logging to allow structured logs
- Loading branch information
Showing
14 changed files
with
117 additions
and
62 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
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,31 @@ | ||
package logger | ||
|
||
import ( | ||
"log" | ||
"os" | ||
) | ||
|
||
// Interface provides the minimal logging interface | ||
type Interface interface { | ||
// Printf prints to the logger using the format. | ||
Printf(format string, v ...interface{}) | ||
// Print prints to the logger. | ||
Print(v ...interface{}) | ||
// Println prints new line. | ||
Println(v ...interface{}) | ||
// Fatal is equivalent to Print() followed by a call to os.Exit(1). | ||
Fatal(v ...interface{}) | ||
// Fatalf is equivalent to Printf() followed by a call to os.Exit(1). | ||
Fatalf(format string, v ...interface{}) | ||
// Fatalln is equivalent to Println() followed by a call to os.Exit(1). | ||
Fatalln(v ...interface{}) | ||
// Panic is equivalent to Print() followed by a call to panic(). | ||
Panic(v ...interface{}) | ||
// Panicf is equivalent to Printf() followed by a call to panic(). | ||
Panicf(format string, v ...interface{}) | ||
// Panicln is equivalent to Println() followed by a call to panic(). | ||
Panicln(v ...interface{}) | ||
} | ||
|
||
// DefaultLogger logs messages to os.Stdout | ||
var DefaultLogger = log.New(os.Stdout, "", log.LstdFlags) |
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
Oops, something went wrong.