From 2e9202693c18a9e03cbbea2c1eba0766a13f0365 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Sun, 27 Oct 2024 08:05:44 +0200 Subject: [PATCH] multi: update deps for btclog v2 module --- fsm/log.go | 2 +- go.mod | 28 ++++++++++------ go.sum | 51 ++++++++++++++++-------------- instantout/log.go | 2 +- instantout/reservation/log.go | 2 +- liquidity/log.go | 2 +- log.go | 2 +- loopd/config.go | 8 +++++ loopd/log.go | 10 +++--- loopd/run.go | 11 ++++--- loopd/swapclient_server_test.go | 12 ++++--- loopdb/log.go | 2 +- loopout_test.go | 7 ++-- notifications/log.go | 2 +- routing_plugin.go | 2 +- swap/log.go | 2 +- sweepbatcher/log.go | 2 +- sweepbatcher/sweep_batch.go | 2 +- sweepbatcher/sweep_batcher.go | 2 +- sweepbatcher/sweep_batcher_test.go | 8 ++--- test/log.go | 6 ++-- 21 files changed, 97 insertions(+), 68 deletions(-) diff --git a/fsm/log.go b/fsm/log.go index d552dd055..8b4c64ff8 100644 --- a/fsm/log.go +++ b/fsm/log.go @@ -1,7 +1,7 @@ package fsm import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/go.mod b/go.mod index 3f2ebb4d4..143325494 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.5 github.com/btcsuite/btcd/btcutil/psbt v1.1.8 github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 - github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f - github.com/btcsuite/btcwallet v0.16.10-0.20240809133323-7d3434c65ae2 - github.com/btcsuite/btcwallet/wtxmgr v1.5.3 + github.com/btcsuite/btclog/v2 v2.0.0-20241017175713-3428138b75c7 + github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5 + github.com/btcsuite/btcwallet/wtxmgr v1.5.4 github.com/coreos/bbolt v1.3.3 github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 @@ -23,7 +23,7 @@ require ( github.com/lightninglabs/lndclient v0.18.4-0 github.com/lightninglabs/loop/looprpc v1.0.0 github.com/lightninglabs/loop/swapserverrpc v1.0.8 - github.com/lightningnetwork/lnd v0.18.3-beta.rc3.0.20241011124628-ca3bde901eb8 + github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20241022180056-b4ef22bf4722 github.com/lightningnetwork/lnd/cert v1.2.2 github.com/lightningnetwork/lnd/clock v1.1.1 github.com/lightningnetwork/lnd/queue v1.1.1 @@ -51,10 +51,11 @@ require ( github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect github.com/aead/siphash v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4 // indirect - github.com/btcsuite/btcwallet/wallet/txrules v1.2.1 // indirect - github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4 // indirect - github.com/btcsuite/btcwallet/walletdb v1.4.2 // indirect + github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c // indirect + github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 // indirect + github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 // indirect + github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 // indirect + github.com/btcsuite/btcwallet/walletdb v1.4.4 // indirect github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect github.com/btcsuite/winsvc v1.0.0 // indirect @@ -108,11 +109,12 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 // indirect github.com/kkdai/bstream v1.0.0 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd // indirect github.com/lightninglabs/neutrino/cache v1.1.2 // indirect github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect - github.com/lightningnetwork/lnd/fn v1.2.1 // indirect + github.com/lightningnetwork/lnd/fn v1.2.3 // indirect github.com/lightningnetwork/lnd/healthcheck v1.2.5 // indirect github.com/lightningnetwork/lnd/kvdb v1.4.10 // indirect github.com/lightningnetwork/lnd/sqldb v1.0.4 // indirect @@ -152,7 +154,7 @@ require ( github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect - go.etcd.io/bbolt v1.3.7 // indirect + go.etcd.io/bbolt v1.3.11 // indirect go.etcd.io/etcd/api/v3 v3.5.7 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect go.etcd.io/etcd/client/v2 v2.305.7 // indirect @@ -209,3 +211,9 @@ replace github.com/lightninglabs/loop/looprpc => ./looprpc go 1.22.6 toolchain go1.22.7 + +replace ( + github.com/lightninglabs/aperture => github.com/ellemouton/aperture v0.0.0-20241027051805-8cd28634e3bc + github.com/lightninglabs/lndclient => github.com/ellemouton/lndclient v1.0.1-0.20241023065244-170dbf90b579 + github.com/lightningnetwork/lnd => github.com/ellemouton/lnd v0.8.0-beta-rc3.0.20241026121832-a03d5fcb9e11 +) diff --git a/go.sum b/go.sum index cd121c056..d99189430 100644 --- a/go.sum +++ b/go.sum @@ -664,21 +664,24 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c h1:4HxD1lBUGUddhzgaNgrCPsFWd7cGYNpeFUgd9ZIgyM0= +github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c/go.mod h1:w7xnGOhwT3lmrS4H3b/D1XAXxvh+tbhUm8xeHN2y3TQ= +github.com/btcsuite/btclog/v2 v2.0.0-20241017175713-3428138b75c7 h1:3Ct3zN3VCEKVm5nceWBBEKczc+jvTfVyOEG71ob2Yuc= +github.com/btcsuite/btclog/v2 v2.0.0-20241017175713-3428138b75c7/go.mod h1:XItGUfVOxotJL8kkuk2Hj3EVow5KCugXl3wWfQ6K0AE= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcwallet v0.16.10-0.20240809133323-7d3434c65ae2 h1:qa4Avm7p97JroZZyMJADbEb9u853pjleJYSeitENvLc= -github.com/btcsuite/btcwallet v0.16.10-0.20240809133323-7d3434c65ae2/go.mod h1:X2xDre+j1QphTRo54y2TikUzeSvreL1t1aMXrD8Kc5A= -github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4 h1:poyHFf7+5+RdxNp5r2T6IBRD7RyraUsYARYbp/7t4D8= -github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4/go.mod h1:GETGDQuyq+VFfH1S/+/7slLM/9aNa4l7P4ejX6dJfb0= -github.com/btcsuite/btcwallet/wallet/txrules v1.2.1 h1:UZo7YRzdHbwhK7Rhv3PO9bXgTxiOH45edK5qdsdiatk= -github.com/btcsuite/btcwallet/wallet/txrules v1.2.1/go.mod h1:MVSqRkju/IGxImXYPfBkG65FgEZYA4fXchheILMVl8g= -github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4 h1:nmcKAVTv/cmYrs0A4hbiC6Qw+WTLYy/14SmTt3mLnCo= -github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4/go.mod h1:YqJR8WAAHiKIPesZTr9Cx9Az4fRhRLcJ6GcxzRUZCAc= -github.com/btcsuite/btcwallet/walletdb v1.4.2 h1:zwZZ+zaHo4mK+FAN6KeK85S3oOm+92x2avsHvFAhVBE= -github.com/btcsuite/btcwallet/walletdb v1.4.2/go.mod h1:7ZQ+BvOEre90YT7eSq8bLoxTsgXidUzA/mqbRS114CQ= -github.com/btcsuite/btcwallet/wtxmgr v1.5.3 h1:QrWCio9Leh3DwkWfp+A1SURj8pYn3JuTLv3waP5uEro= -github.com/btcsuite/btcwallet/wtxmgr v1.5.3/go.mod h1:M4nQpxGTXiDlSOODKXboXX7NFthmiBNjzAKKNS7Fhjg= +github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5 h1:zYy233eUBvkF3lq2MUkybEhxhDsrRDSgiToIKN57mtk= +github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5/go.mod h1:1HJXYbjJzgumlnxOC2+ViR1U+gnHWoOn7WeK5OfY1eU= +github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 h1:Rr0njWI3r341nhSPesKQ2JF+ugDSzdPoeckS75SeDZk= +github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5/go.mod h1:+tXJ3Ym0nlQc/iHSwW1qzjmPs3ev+UVWMbGgfV1OZqU= +github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 h1:YEO+Lx1ZJJAtdRrjuhXjWrYsmAk26wLTlNzxt2q0lhk= +github.com/btcsuite/btcwallet/wallet/txrules v1.2.2/go.mod h1:4v+grppsDpVn91SJv+mZT7B8hEV4nSmpREM4I8Uohws= +github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 h1:93o5Xz9dYepBP4RMFUc9RGIFXwqP2volSWRkYJFrNtI= +github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5/go.mod h1:lQ+e9HxZ85QP7r3kdxItkiMSloSLg1PEGis5o5CXUQw= +github.com/btcsuite/btcwallet/walletdb v1.4.4 h1:BDel6iT/ltYSIYKs0YbjwnEDi7xR3yzABIsQxN2F1L8= +github.com/btcsuite/btcwallet/walletdb v1.4.4/go.mod h1:jk/hvpLFINF0C1kfTn0bfx2GbnFT+Nvnj6eblZALfjs= +github.com/btcsuite/btcwallet/wtxmgr v1.5.4 h1:hJjHy1h/dJwSfD9uDsCwcH21D1iOrus6OrI5gR9E/O0= +github.com/btcsuite/btcwallet/wtxmgr v1.5.4/go.mod h1:lAv0b1Vj9Ig5U8QFm0yiJ9WqPl8yGO/6l7JxdHY1PKE= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8/go.mod h1:tYvUd8KLhm/oXvUeSEs2VlLghFjQt9+ZaF9ghH0JNjc= @@ -776,6 +779,12 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/ellemouton/aperture v0.0.0-20241027051805-8cd28634e3bc h1:/TldIQ39pY879I6544R7p7tSURI52sTrLY2M6CNTaeo= +github.com/ellemouton/aperture v0.0.0-20241027051805-8cd28634e3bc/go.mod h1:rOetkvJdd66Ctg9fMAuw1492xcvw10uCvKu0AfrxAO4= +github.com/ellemouton/lnd v0.8.0-beta-rc3.0.20241026121832-a03d5fcb9e11 h1:WaKXIKKKVulx4xlIepGH+EJalMqq+khDWkQgdXpxrqk= +github.com/ellemouton/lnd v0.8.0-beta-rc3.0.20241026121832-a03d5fcb9e11/go.mod h1:AAijN90Q69V+vPQ7rSaf7Ui7KGdLBU7g7XKnQb2apw8= +github.com/ellemouton/lndclient v1.0.1-0.20241023065244-170dbf90b579 h1:VBfkVqSHpr7d0ZCX8kmSlPKb/yfwCfmlqPP5eQmndfc= +github.com/ellemouton/lndclient v1.0.1-0.20241023065244-170dbf90b579/go.mod h1:YBHDD/95qTbfpmKJMwSEDhJT9b3lMx8SDzwWetpYQgg= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -1093,6 +1102,8 @@ github.com/kkdai/bstream v1.0.0 h1:Se5gHwgp2VT2uHfDrkbbgbgEvV9cimLELwrPJctSjg8= github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1115,12 +1126,8 @@ github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightninglabs/aperture v0.3.2-beta h1:J2GQwBmSHxpr5VOatXbgrTogF/qN2l6UWLPHfIowq10= -github.com/lightninglabs/aperture v0.3.2-beta/go.mod h1:M/5dPzHjHvuYXQuxzicqaGiCclHUvKW6N0ay1t/HGiM= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc= github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= -github.com/lightninglabs/lndclient v0.18.4-0 h1:TdorvV9UIw3fjZrNpVKn3fpsOdw2KWF2Eqdx7+++lcY= -github.com/lightninglabs/lndclient v0.18.4-0/go.mod h1:LbINSPfKEdZuTGqqJ+ZmUxXWNvUCaDqrZeJ7/Al0Z3Y= github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd h1:D8aRocHpoCv43hL8egXEMYyPmyOiefFHZ66338KQB2s= github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk= github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g= @@ -1129,14 +1136,12 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY= github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI= -github.com/lightningnetwork/lnd v0.18.3-beta.rc3.0.20241011124628-ca3bde901eb8 h1:+z0s8M0QItH51qMPgFGlRvi6uBltbURQj6u1srTyRb4= -github.com/lightningnetwork/lnd v0.18.3-beta.rc3.0.20241011124628-ca3bde901eb8/go.mod h1:gzVQkOCZxTLzlUPqnI6t68FVGLbiO6Jj+TcLb4b78n0= github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI= github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U= github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0= github.com/lightningnetwork/lnd/clock v1.1.1/go.mod h1:mGnAhPyjYZQJmebS7aevElXKTFDuO+uNFFfMXK1W8xQ= -github.com/lightningnetwork/lnd/fn v1.2.1 h1:pPsVGrwi9QBwdLJzaEGK33wmiVKOxs/zc8H7+MamFf0= -github.com/lightningnetwork/lnd/fn v1.2.1/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0= +github.com/lightningnetwork/lnd/fn v1.2.3 h1:Q1OrgNSgQynVheBNa16CsKVov1JI5N2AR6G07x9Mles= +github.com/lightningnetwork/lnd/fn v1.2.3/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0= github.com/lightningnetwork/lnd/healthcheck v1.2.5 h1:aTJy5xeBpcWgRtW/PGBDe+LMQEmNm/HQewlQx2jt7OA= github.com/lightningnetwork/lnd/healthcheck v1.2.5/go.mod h1:G7Tst2tVvWo7cx6mSBEToQC5L1XOGxzZTPB29g9Rv2I= github.com/lightningnetwork/lnd/kvdb v1.4.10 h1:vK89IVv1oVH9ubQWU+EmoCQFeVRaC8kfmOrqHbY5zoY= @@ -1342,8 +1347,8 @@ github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaD github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec h1:FpfFs4EhNehiVfzQttTuxanPIT43FtkkCFypIod8LHo= gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= +go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= go.etcd.io/etcd/api/v3 v3.5.7 h1:sbcmosSVesNrWOJ58ZQFitHMdncusIifYcrBfwrlJSY= go.etcd.io/etcd/api/v3 v3.5.7/go.mod h1:9qew1gCdDDLu+VwmeG+iFpL+QlpHTo7iubavdVDgCAA= go.etcd.io/etcd/client/pkg/v3 v3.5.7 h1:y3kf5Gbp4e4q7egZdn5T7W9TSHUvkClN6u+Rq9mEOmg= diff --git a/instantout/log.go b/instantout/log.go index 75764f5dc..e4f3a4676 100644 --- a/instantout/log.go +++ b/instantout/log.go @@ -1,7 +1,7 @@ package instantout import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/instantout/reservation/log.go b/instantout/reservation/log.go index c7f818f49..b0a8bf546 100644 --- a/instantout/reservation/log.go +++ b/instantout/reservation/log.go @@ -1,7 +1,7 @@ package reservation import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/liquidity/log.go b/liquidity/log.go index 39a3ebe06..0083b49cf 100644 --- a/liquidity/log.go +++ b/liquidity/log.go @@ -1,7 +1,7 @@ package liquidity import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/log.go b/log.go index 289f2a204..27c5ce1fc 100644 --- a/log.go +++ b/log.go @@ -1,7 +1,7 @@ package loop import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/loopd/config.go b/loopd/config.go index 586f9ffb4..b1e8a1051 100644 --- a/loopd/config.go +++ b/loopd/config.go @@ -12,6 +12,7 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/loop/loopdb" + "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/cert" "github.com/lightningnetwork/lnd/lncfg" "github.com/lightningnetwork/lnd/lnrpc" @@ -111,6 +112,8 @@ var ( // DefaultAutogenValidity is the default validity of a self-signed // certificate in number of days. DefaultAutogenValidity = 365 * 24 * time.Hour + + defaultLogCompressor = build.Gzip ) type lndConfig struct { @@ -169,6 +172,7 @@ type Config struct { MacaroonPath string `long:"macaroonpath" description:"Path to write the macaroon for loop's RPC and REST services if it doesn't exist."` LogDir string `long:"logdir" description:"Directory to log output."` + LogCompressor string `long:"logcompressor" description:"Compression algorithm to use when rotating logs." choice:"gzip" choice:"zstd"` MaxLogFiles int `long:"maxlogfiles" description:"Maximum logfiles to keep (0 for no rotation)."` MaxLogFileSize int `long:"maxlogfilesize" description:"Maximum logfile size in MB."` @@ -192,6 +196,8 @@ type Config struct { Server *loopServerConfig `group:"server" namespace:"server"` View viewParameters `command:"view" alias:"v" description:"View all swaps in the database. This command can only be executed when loopd is not running."` + + Logging *build.LogConfig `group:"logging" namespace:"logging"` } const ( @@ -235,6 +241,8 @@ func DefaultConfig() Config { MacaroonPath: DefaultLndMacaroonPath, RPCTimeout: DefaultLndRPCTimeout, }, + Logging: build.DefaultLogConfig(), + LogCompressor: defaultLogCompressor, } } diff --git a/loopd/log.go b/loopd/log.go index a4f433f01..44c3505e2 100644 --- a/loopd/log.go +++ b/loopd/log.go @@ -1,7 +1,7 @@ package loopd import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightninglabs/aperture/l402" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" @@ -20,16 +20,16 @@ import ( const Subsystem = "LOOPD" var ( - logWriter *build.RotatingLogWriter + subLogMgr *build.SubLoggerManager log btclog.Logger interceptor signal.Interceptor ) // SetupLoggers initializes all package-global logger variables. -func SetupLoggers(root *build.RotatingLogWriter, intercept signal.Interceptor) { +func SetupLoggers(root *build.SubLoggerManager, intercept signal.Interceptor) { genLogger := genSubLogger(root, intercept) - logWriter = root + subLogMgr = root log = build.NewSubLogger(Subsystem, genLogger) interceptor = intercept @@ -56,7 +56,7 @@ func SetupLoggers(root *build.RotatingLogWriter, intercept signal.Interceptor) { // genSubLogger creates a logger for a subsystem. We provide an instance of // a signal.Interceptor to be able to shutdown in the case of a critical error. -func genSubLogger(root *build.RotatingLogWriter, +func genSubLogger(root *build.SubLoggerManager, interceptor signal.Interceptor) func(string) btclog.Logger { // Create a shutdown function which will request shutdown from our diff --git a/loopd/run.go b/loopd/run.go index 34b2cd70d..5db6d864f 100644 --- a/loopd/run.go +++ b/loopd/run.go @@ -183,7 +183,7 @@ func Run(rpcCfg RPCConfig) error { // Special show command to list supported subsystems and exit. if config.DebugLevel == "show" { fmt.Printf("Supported subsystems: %v\n", - logWriter.SupportedSubsystems()) + subLogMgr.SupportedSubsystems()) os.Exit(0) } @@ -203,16 +203,19 @@ func Run(rpcCfg RPCConfig) error { // Initialize logging at the default logging level. logWriter := build.NewRotatingLogWriter() - SetupLoggers(logWriter, shutdownInterceptor) + subLogMgr := build.NewSubLoggerManager( + build.NewDefaultLogHandlers(config.Logging, logWriter)..., + ) + SetupLoggers(subLogMgr, shutdownInterceptor) err = logWriter.InitLogRotator( filepath.Join(config.LogDir, defaultLogFilename), - config.MaxLogFileSize, config.MaxLogFiles, + config.LogCompressor, config.MaxLogFileSize, config.MaxLogFiles, ) if err != nil { return err } - err = build.ParseAndSetDebugLevels(config.DebugLevel, logWriter) + err = build.ParseAndSetDebugLevels(config.DebugLevel, subLogMgr) if err != nil { return err } diff --git a/loopd/swapclient_server_test.go b/loopd/swapclient_server_test.go index 2cdd2359d..6b8c6240c 100644 --- a/loopd/swapclient_server_test.go +++ b/loopd/swapclient_server_test.go @@ -3,10 +3,12 @@ package loopd import ( "context" "errors" + "os" "testing" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg" + "github.com/btcsuite/btclog/v2" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/labels" @@ -472,10 +474,12 @@ func TestValidateLoopOutRequest(t *testing.T) { } log = build.NewSubLogger( - Subsystem, - genSubLogger( - build.NewRotatingLogWriter(), - interceptor, + Subsystem, genSubLogger( + build.NewSubLoggerManager( + btclog.NewDefaultHandler( + os.Stdout, + ), + ), interceptor, ), ) conf, err := validateLoopOutRequest( diff --git a/loopdb/log.go b/loopdb/log.go index ff7bb45fa..935a944e8 100644 --- a/loopdb/log.go +++ b/loopdb/log.go @@ -1,7 +1,7 @@ package loopdb import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/loopout_test.go b/loopout_test.go index f28b3b02f..b94f165b3 100644 --- a/loopout_test.go +++ b/loopout_test.go @@ -12,7 +12,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/loopdb" "github.com/lightninglabs/loop/sweep" @@ -258,8 +258,9 @@ func testCustomSweepConfTarget(t *testing.T) { defer test.Guard(t)() // Setup logger for sweepbatcher. - logger := btclog.NewBackend(os.Stdout).Logger("SWEEP") - logger.SetLevel(btclog.LevelTrace) + handler := btclog.NewDefaultHandler(os.Stdout).SubSystem("SWEEP") + handler.SetLevel(btclog.LevelTrace) + logger := btclog.NewSLogger(handler) sweepbatcher.UseLogger(logger) lnd := test.NewMockLnd() diff --git a/notifications/log.go b/notifications/log.go index 5fb30f100..ba4b527ad 100644 --- a/notifications/log.go +++ b/notifications/log.go @@ -1,7 +1,7 @@ package notifications import ( - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/routing_plugin.go b/routing_plugin.go index 703472973..91709eeea 100644 --- a/routing_plugin.go +++ b/routing_plugin.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/btcsuite/btcd/btcutil" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/davecgh/go-spew/spew" "github.com/lightninglabs/lndclient" "github.com/lightningnetwork/lnd/clock" diff --git a/swap/log.go b/swap/log.go index 4afed7096..6812c0d81 100644 --- a/swap/log.go +++ b/swap/log.go @@ -3,7 +3,7 @@ package swap import ( "fmt" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/lntypes" ) diff --git a/sweepbatcher/log.go b/sweepbatcher/log.go index 24d6cc297..c3906bb5d 100644 --- a/sweepbatcher/log.go +++ b/sweepbatcher/log.go @@ -3,7 +3,7 @@ package sweepbatcher import ( "fmt" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightningnetwork/lnd/build" ) diff --git a/sweepbatcher/sweep_batch.go b/sweepbatcher/sweep_batch.go index 2e815899e..ebd52fe9c 100644 --- a/sweepbatcher/sweep_batch.go +++ b/sweepbatcher/sweep_batch.go @@ -19,7 +19,7 @@ import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/loopdb" "github.com/lightninglabs/loop/swap" diff --git a/sweepbatcher/sweep_batcher.go b/sweepbatcher/sweep_batcher.go index 6b819e433..ea0bed650 100644 --- a/sweepbatcher/sweep_batcher.go +++ b/sweepbatcher/sweep_batcher.go @@ -13,7 +13,7 @@ import ( "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/btcsuite/btcwallet/chain" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/labels" diff --git a/sweepbatcher/sweep_batcher_test.go b/sweepbatcher/sweep_batcher_test.go index def11c9b4..c602922f2 100644 --- a/sweepbatcher/sweep_batcher_test.go +++ b/sweepbatcher/sweep_batcher_test.go @@ -14,7 +14,7 @@ import ( "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/loopdb" "github.com/lightninglabs/loop/test" @@ -4104,9 +4104,9 @@ func (s *loopdbStore) AssertLoopOutStored() { func runTests(t *testing.T, testFn func(t *testing.T, store testStore, batcherStore testBatcherStore)) { - logger := btclog.NewBackend(os.Stdout).Logger("SWEEP") - logger.SetLevel(btclog.LevelTrace) - UseLogger(logger) + handler := btclog.NewDefaultHandler(os.Stdout).SubSystem("SWEEP") + handler.SetLevel(btclog.LevelTrace) + UseLogger(btclog.NewSLogger(handler)) t.Run("mocks", func(t *testing.T) { store := loopdb.NewStoreMock(t) diff --git a/test/log.go b/test/log.go index 15fc84e21..3e302e91c 100644 --- a/test/log.go +++ b/test/log.go @@ -3,15 +3,15 @@ package test import ( "os" - "github.com/btcsuite/btclog" + "github.com/btcsuite/btclog/v2" ) // 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 ( - backendLog = btclog.NewBackend(logWriter{}) - logger = backendLog.Logger("TEST") + backendLog = btclog.NewDefaultHandler(logWriter{}) + logger = btclog.NewSLogger(backendLog.SubSystem("TEST")) ) // logWriter implements an io.Writer that outputs to both standard output and