forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 2
/
logbridge.go
55 lines (44 loc) · 1.27 KB
/
logbridge.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
/*
Notice: This file has been modified for Hyperledger Fabric SDK Go usage.
Please review third_party pinning scripts and patches for more details.
*/
package logbridge
import (
clog "github.com/cloudflare/cfssl/log"
"github.com/hyperledger/fabric-sdk-go/pkg/common/logging"
)
var logger *logging.Logger
var cfLogBridge *cLogger
func init() {
logger = logging.NewLogger("fabsdk/fab")
cfLogBridge = &cLogger{}
clog.SetLogger(cfLogBridge)
}
// Debug bridges calls to the Go SDK logger's Debug.
func Debug(args ...interface{}) {
logger.Debug(args...)
}
// Debugf bridges calls to the Go SDK logger's Debugf.
func Debugf(format string, args ...interface{}) {
logger.Debugf(format, args)
}
// Info bridges calls to the Go SDK logger's Info.
func Info(args ...interface{}) {
logger.Info(args...)
}
// Infof bridges calls to the Go SDK logger's Debugf.
func Infof(format string, args ...interface{}) {
logger.Infof(format, args...)
}
// Warning bridges calls to the Go SDK logger's Warn.
func Warning(args ...interface{}) {
logger.Warn(args...)
}
// Fatalf bridges calls to the Go SDK logger's Debugf.
func Fatalf(format string, args ...interface{}) {
logger.Fatalf(format, args...)
}