func errorLogUnaryClientInterceptor(logger btclog.Logger) grpc.UnaryClientInterceptor {
	return func(ctx context.Context, method string, req, reply interface{},
		cc *grpc.ClientConn, invoker grpc.UnaryInvoker,
		opts ...grpc.CallOption) error {
		err := invoker(ctx, method, req, reply, cc, opts...)
		if err != nil {
			logger.Errorf("[%v]: %v", method, err)
		}
		return err
	}
}
errorLogUnaryClientInterceptor is a simple UnaryClientInterceptor that will
automatically log any errors that occur when executing a unary request to
the server.
package pool
import (
	"context"
	"github.com/btcsuite/btclog"
	"github.com/lightninglabs/aperture/lsat"
	"github.com/lightninglabs/lndclient"
	"github.com/lightninglabs/pool/account"
	"github.com/lightninglabs/pool/auctioneer"
	"github.com/lightninglabs/pool/clientdb"
	"github.com/lightninglabs/pool/funding"
	"github.com/lightninglabs/pool/order"
	"github.com/lightningnetwork/lnd"
	"github.com/lightningnetwork/lnd/build"
	"github.com/lightningnetwork/lnd/signal"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)
const Subsystem = "POOL"
var (
	logWriter   = build.NewRotatingLogWriter()
	log         = build.NewSubLogger(Subsystem, nil)
	rpcLog      = build.NewSubLogger("RPCS", nil)
	sdcrLog     = build.NewSubLogger("SDCR", nil)
	interceptor signal.Interceptor
)
func SetupLoggers(root *build.RotatingLogWriter, intercept signal.Interceptor) {
	genLogger := genSubLogger(root, intercept)
	logWriter = root
	log = build.NewSubLogger(Subsystem, genLogger)
	rpcLog = build.NewSubLogger("RPCS", genLogger)
	sdcrLog = build.NewSubLogger("SDCR", genLogger)
	interceptor = intercept
	lnd.SetSubLogger(root, Subsystem, log)
	lnd.SetSubLogger(root, "RPCS", rpcLog)
	lnd.SetSubLogger(root, "SDCR", sdcrLog)
	lnd.AddSubLogger(root, funding.Subsystem, intercept, funding.UseLogger)
	lnd.AddSubLogger(
		root, auctioneer.Subsystem, intercept, auctioneer.UseLogger,
	)
	lnd.AddSubLogger(root, order.Subsystem, intercept, order.UseLogger)
	lnd.AddSubLogger(root, "LNDC", intercept, lndclient.UseLogger)
	lnd.AddSubLogger(root, "SGNL", intercept, signal.UseLogger)
	lnd.AddSubLogger(root, account.Subsystem, intercept, account.UseLogger)
	lnd.AddSubLogger(root, lsat.Subsystem, intercept, lsat.UseLogger)
	lnd.AddSubLogger(
		root, clientdb.Subsystem, intercept, clientdb.UseLogger,
	)
}
func genSubLogger(root *build.RotatingLogWriter,
	interceptor signal.Interceptor) func(string) btclog.Logger {
	shutdown := func() {
		if !interceptor.Listening() {
			return
		}
		interceptor.RequestShutdown()
	}
	return func(tag string) btclog.Logger {
		return root.GenSubLogger(tag, shutdown)
	}
}
func errorLogUnaryServerInterceptor(logger btclog.Logger) grpc.UnaryServerInterceptor {
	return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
		handler grpc.UnaryHandler) (interface{}, error) {
		resp, err := handler(ctx, req)
		if err != nil {
			logger.Errorf("[%v]: %v", info.FullMethod, err)
		}
		return resp, err
	}
}