mirror of
https://github.com/status-im/go-waku.git
synced 2025-02-27 12:30:39 +00:00
fix: logLevel
This commit is contained in:
parent
65441f60e0
commit
cedaa670c7
@ -9,6 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
golog "github.com/ipfs/go-log/v2"
|
||||
"github.com/libp2p/go-libp2p"
|
||||
"go.uber.org/zap"
|
||||
|
||||
@ -129,6 +130,7 @@ func New(opts ...WakuNodeOption) (*WakuNode, error) {
|
||||
|
||||
if params.logger == nil {
|
||||
params.logger = utils.Logger()
|
||||
golog.SetAllLoggers(params.logLevel)
|
||||
}
|
||||
|
||||
if params.privKey == nil {
|
||||
|
@ -58,7 +58,8 @@ type WakuNodeParameters struct {
|
||||
wssPort int
|
||||
tlsConfig *tls.Config
|
||||
|
||||
logger *zap.Logger
|
||||
logger *zap.Logger
|
||||
logLevel logging.LogLevel
|
||||
|
||||
noDefaultWakuTopic bool
|
||||
enableRelay bool
|
||||
@ -150,7 +151,8 @@ func WithLogger(l *zap.Logger) WakuNodeOption {
|
||||
// WithLogLevel is a WakuNodeOption that sets the log level for go-waku
|
||||
func WithLogLevel(lvl zapcore.Level) WakuNodeOption {
|
||||
return func(params *WakuNodeParameters) error {
|
||||
logging.SetAllLoggers(logging.LogLevel(lvl))
|
||||
params.logLevel = logging.LogLevel(lvl)
|
||||
logging.SetAllLoggers(params.logLevel)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user