mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
config: disable internal GRPC logger by default
The GRPC connection logger is very verbose and normally not very useful. So it leads to more confusion and unnecessary log bloat than it actually helps to debug things. So we disable it by default, meaning that if GRPC=<level> doesn't appear in the log level config string, we add GRPC=off. That means we can still manually turn it on by adding ,GRPC=info to the log config (e.g. --lnd.debuglevel=debug,GRPC=info).
This commit is contained in:
parent
cb6977ff2d
commit
05fc878191
1 changed files with 11 additions and 7 deletions
18
config.go
18
config.go
|
|
@ -386,15 +386,19 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
|
|||
// the debug log level(s). In remote lnd mode we have a global log level
|
||||
// that overwrites all others. In integrated mode we use the lnd log
|
||||
// level as the master level.
|
||||
debuglevel := cfg.Lnd.DebugLevel
|
||||
if cfg.lndRemote {
|
||||
err = build.ParseAndSetDebugLevels(
|
||||
cfg.Remote.LitDebugLevel, cfg.Lnd.LogWriter,
|
||||
)
|
||||
} else {
|
||||
err = build.ParseAndSetDebugLevels(
|
||||
cfg.Lnd.DebugLevel, cfg.Lnd.LogWriter,
|
||||
)
|
||||
debuglevel = cfg.Remote.LitDebugLevel
|
||||
}
|
||||
|
||||
// By default, we don't want the GRPC connection-level logger to be
|
||||
// turned on. So if it isn't specifically mentioned in the debug level
|
||||
// string, we'll disable it.
|
||||
if !strings.Contains(debuglevel, GrpcLogSubsystem) {
|
||||
debuglevel += fmt.Sprintf(",%s=off", GrpcLogSubsystem)
|
||||
}
|
||||
|
||||
err = build.ParseAndSetDebugLevels(debuglevel, cfg.Lnd.LogWriter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue