From d4021c5aca12b976940f729c2aae478912a0a39c Mon Sep 17 00:00:00 2001 From: positiveblue Date: Fri, 3 Dec 2021 13:15:37 -0800 Subject: [PATCH] lnrpc: fix `log.go` files The `log.go` file of each subserver is a copy and paste of the others. All of them have the same typo, an extra space in a comment, and the the definition of a function not used anywhere. --- lnrpc/autopilotrpc/log.go | 20 ++------------------ lnrpc/chainrpc/log.go | 18 +----------------- lnrpc/invoicesrpc/log.go | 4 ++-- lnrpc/peersrpc/log.go | 20 ++------------------ lnrpc/routerrpc/log.go | 18 +----------------- lnrpc/signrpc/log.go | 18 +----------------- lnrpc/verrpc/log.go | 2 +- lnrpc/walletrpc/log.go | 20 ++------------------ lnrpc/watchtowerrpc/log.go | 16 ---------------- 9 files changed, 12 insertions(+), 124 deletions(-) diff --git a/lnrpc/autopilotrpc/log.go b/lnrpc/autopilotrpc/log.go index e844bcab9..113486d0d 100644 --- a/lnrpc/autopilotrpc/log.go +++ b/lnrpc/autopilotrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This means the +// log is a logger that is initialized with no output filters. This means the // package will not perform any logging by default until the caller requests // it. var log btclog.Logger @@ -21,25 +21,9 @@ func DisableLog() { UseLogger(btclog.Disabled) } -// UseLogger uses a specified Logger to output package logging info. This +// UseLogger uses a specified Logger to output package logging info. This // should be used in preference to SetLogWriter if the caller is also using // btclog. func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -} diff --git a/lnrpc/chainrpc/log.go b/lnrpc/chainrpc/log.go index 0d47ea971..6b68e324a 100644 --- a/lnrpc/chainrpc/log.go +++ b/lnrpc/chainrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This +// log is a logger that is initialized with no output filters. This // means the package will not perform any logging by default until the caller // requests it. var log btclog.Logger @@ -27,19 +27,3 @@ func DisableLog() { func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -} diff --git a/lnrpc/invoicesrpc/log.go b/lnrpc/invoicesrpc/log.go index d29c73780..8429ee51c 100644 --- a/lnrpc/invoicesrpc/log.go +++ b/lnrpc/invoicesrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This means the +// log is a logger that is initialized with no output filters. This means the // package will not perform any logging by default until the caller requests // it. var log btclog.Logger @@ -21,7 +21,7 @@ func DisableLog() { UseLogger(btclog.Disabled) } -// UseLogger uses a specified Logger to output package logging info. This +// UseLogger uses a specified Logger to output package logging info. This // should be used in preference to SetLogWriter if the caller is also using // btclog. func UseLogger(logger btclog.Logger) { diff --git a/lnrpc/peersrpc/log.go b/lnrpc/peersrpc/log.go index 13bc6c354..3fd59789c 100644 --- a/lnrpc/peersrpc/log.go +++ b/lnrpc/peersrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This means the +// log is a logger that is initialized with no output filters. This means the // package will not perform any logging by default until the caller requests // it. var log btclog.Logger @@ -24,25 +24,9 @@ func DisableLog() { UseLogger(btclog.Disabled) } -// UseLogger uses a specified Logger to output package logging info. This +// UseLogger uses a specified Logger to output package logging info. This // should be used in preference to SetLogWriter if the caller is also using // btclog. func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -} diff --git a/lnrpc/routerrpc/log.go b/lnrpc/routerrpc/log.go index 6cbd8bea3..5c4ad01d8 100644 --- a/lnrpc/routerrpc/log.go +++ b/lnrpc/routerrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This +// log is a logger that is initialized with no output filters. This // means the package will not perform any logging by default until the caller // requests it. var log btclog.Logger @@ -30,19 +30,3 @@ func DisableLog() { func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -} diff --git a/lnrpc/signrpc/log.go b/lnrpc/signrpc/log.go index b5ff742a0..2dc653343 100644 --- a/lnrpc/signrpc/log.go +++ b/lnrpc/signrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This +// log is a logger that is initialized with no output filters. This // means the package will not perform any logging by default until the caller // requests it. var log btclog.Logger @@ -27,19 +27,3 @@ func DisableLog() { func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -} diff --git a/lnrpc/verrpc/log.go b/lnrpc/verrpc/log.go index fb57daa21..3553b5680 100644 --- a/lnrpc/verrpc/log.go +++ b/lnrpc/verrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This +// log is a logger that is initialized with no output filters. This // means the package will not perform any logging by default until the caller // requests it. var log btclog.Logger diff --git a/lnrpc/walletrpc/log.go b/lnrpc/walletrpc/log.go index 5c14879f6..1916c549f 100644 --- a/lnrpc/walletrpc/log.go +++ b/lnrpc/walletrpc/log.go @@ -5,7 +5,7 @@ import ( "github.com/lightningnetwork/lnd/build" ) -// log is a logger that is initialized with no output filters. This means the +// log is a logger that is initialized with no output filters. This means the // package will not perform any logging by default until the caller requests // it. var log btclog.Logger @@ -21,25 +21,9 @@ func DisableLog() { UseLogger(btclog.Disabled) } -// UseLogger uses a specified Logger to output package logging info. This +// UseLogger uses a specified Logger to output package logging info. This // should be used in preference to SetLogWriter if the caller is also using // btclog. func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -} diff --git a/lnrpc/watchtowerrpc/log.go b/lnrpc/watchtowerrpc/log.go index 0ff4e6801..a71b7827f 100644 --- a/lnrpc/watchtowerrpc/log.go +++ b/lnrpc/watchtowerrpc/log.go @@ -29,19 +29,3 @@ func DisableLog() { func UseLogger(logger btclog.Logger) { log = logger } - -// logClosure is used to provide a closure over expensive logging operations so -// don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string // nolint:unused - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { // nolint:unused - return logClosure(c) -}