forked from hyperledger/fabric
-
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.
[FAB-14399] move idemix.proto out into idemix
Change-Id: I9b89b20641352dac94759c96c005dcddb917862f Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
- Loading branch information
Showing
5 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
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,37 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package idemix | ||
|
||
import "log" | ||
|
||
// logger is used to log debug information. | ||
var logger Logger = LogFunc(log.Printf) | ||
|
||
// SetLogger sets the logger instance used for debug and error reporting. The | ||
// logger reference is not mutex-protected so this must be set before calling | ||
// any other library functions. | ||
// | ||
// If a custom logger is not defined, the global logger from the standard | ||
// library's log package is used. | ||
func SetLogger(l Logger) { | ||
logger = l | ||
} | ||
|
||
// Logger defines the contract for logging. This interface is explicitly | ||
// defined to be compatible with the logger in the standard library log | ||
// package. | ||
type Logger interface { | ||
Printf(format string, a ...interface{}) | ||
} | ||
|
||
// LogFunc is a function adapter for logging. | ||
type LogFunc func(format string, a ...interface{}) | ||
|
||
// Printf is used to create a formatted string log record. | ||
func (l LogFunc) Printf(format string, a ...interface{}) { | ||
l(format, a...) | ||
} |
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