-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export Logger to customize ldapserver output.
use ldap.Logger = ldap.DiscardingLogger to discard ldapserver logs
- Loading branch information
Showing
6 changed files
with
65 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package ldapserver | ||
|
||
import ( | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
) | ||
|
||
var Logger logger | ||
|
||
// Logger represents log.Logger functions from the standard library | ||
type logger interface { | ||
Fatal(v ...interface{}) | ||
Fatalf(format string, v ...interface{}) | ||
Fatalln(v ...interface{}) | ||
|
||
Panic(v ...interface{}) | ||
Panicf(format string, v ...interface{}) | ||
Panicln(v ...interface{}) | ||
|
||
Print(v ...interface{}) | ||
Printf(format string, v ...interface{}) | ||
Println(v ...interface{}) | ||
} | ||
|
||
func init() { | ||
Logger = log.New(os.Stdout, "", log.LstdFlags) | ||
} | ||
|
||
var ( | ||
// DiscardingLogger can be used to disable logging output | ||
DiscardingLogger = log.New(ioutil.Discard, "", 0) | ||
) |
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