mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-16 13:01:14 +02:00
This commit adds a prefixed logger that is then used to log trace information about a payment. This will make it easy to see from the logs which account ID is making the request, what the request ID is and what the relavant payment hash is.
25 lines
635 B
Go
25 lines
635 B
Go
package accounts
|
|
|
|
import (
|
|
"github.com/btcsuite/btclog"
|
|
"github.com/lightningnetwork/lnd/build"
|
|
)
|
|
|
|
const Subsystem = "ACNT"
|
|
|
|
// 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
|
|
|
|
// The default amount of logging is none.
|
|
func init() {
|
|
UseLogger(build.NewSubLogger(Subsystem, nil))
|
|
}
|
|
|
|
// 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
|
|
}
|