Skip to content

Commit

Permalink
Merge pull request #876 from iotaledger/feat/async-logging
Browse files Browse the repository at this point in the history
Feat: Async Logging
  • Loading branch information
piotrm50 authored Mar 26, 2024
2 parents eaa246e + 3c0aace commit b18b728
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 122 deletions.
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.1
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/iotaledger/hive.go/ads v0.0.0-20240315104458-b689cbcfddbd
github.com/iotaledger/hive.go/app v0.0.0-20240315104458-b689cbcfddbd
github.com/iotaledger/hive.go/constraints v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/crypto v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/db v0.0.0-20240315104458-b689cbcfddbd
github.com/iotaledger/hive.go/ds v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/ierrors v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/kvstore v0.0.0-20240315104458-b689cbcfddbd
github.com/iotaledger/hive.go/lo v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/log v0.0.0-20240315104458-b689cbcfddbd
github.com/iotaledger/hive.go/runtime v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/sql v0.0.0-20240315104458-b689cbcfddbd
github.com/iotaledger/hive.go/stringify v0.0.0-20240320122938-13a946cf3c7a
github.com/iotaledger/hive.go/ads v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/app v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/constraints v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/crypto v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/db v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/ds v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/ierrors v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/kvstore v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/lo v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/log v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/runtime v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/sql v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/hive.go/stringify v0.0.0-20240326102522-2e37ab3611a3
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240307101848-db58eb9353ec
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240307100839-48553e1d2022
github.com/iotaledger/iota.go/v4 v4.0.0-20240322114706-82a1f8a8b70c
Expand All @@ -48,7 +48,7 @@ require (
golang.org/x/crypto v0.21.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
gorm.io/gorm v1.25.7
gorm.io/gorm v1.25.8
)

require (
Expand Down Expand Up @@ -84,7 +84,7 @@ require (
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
github.com/google/pprof v0.0.0-20240319011627-a57c5dfe54fd // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
Expand All @@ -102,7 +102,7 @@ require (
github.com/ipld/go-ipld-prime v0.21.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgx/v5 v5.5.4 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
Expand Down Expand Up @@ -191,7 +191,7 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/postgres v1.5.6 // indirect
gorm.io/driver/postgres v1.5.7 // indirect
gorm.io/driver/sqlite v1.5.5 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)
75 changes: 38 additions & 37 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q=
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/pprof v0.0.0-20240319011627-a57c5dfe54fd h1:LjW4RcTwfcqOYGmD7UpFrn1gfBZ9mgu7QN5mSeFkCog=
github.com/google/pprof v0.0.0-20240319011627-a57c5dfe54fd/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down Expand Up @@ -289,36 +290,36 @@ github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJ
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys=
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw=
github.com/iotaledger/hive.go/ads v0.0.0-20240315104458-b689cbcfddbd h1:VKd76foXMN7KRKtfV2+RBQKZYmR5ODKXrl+1liFxn38=
github.com/iotaledger/hive.go/ads v0.0.0-20240315104458-b689cbcfddbd/go.mod h1:tkWq2sJR/vWkbht1BJNIvNP6hJAaRye99wid0A2oU9I=
github.com/iotaledger/hive.go/app v0.0.0-20240315104458-b689cbcfddbd h1:iPJuddZjwPMdUijkonpYKnP+xfaTJCpQr8O5dFiOABw=
github.com/iotaledger/hive.go/app v0.0.0-20240315104458-b689cbcfddbd/go.mod h1:EMUpj6oDb/QSiVpIe5nYwyDKSpO6ue7mdkzmK/VoBn8=
github.com/iotaledger/hive.go/constraints v0.0.0-20240320122938-13a946cf3c7a h1:utdBWBurkt1DyATIR5ciGbU9DzBsv7lsh5O1lIPQvt0=
github.com/iotaledger/hive.go/constraints v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:JF7jjkL6tSUOXm23SWadBzBrl7eJk1DQRLc/fNoVZ+o=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240320122938-13a946cf3c7a h1:m9dJP6aScnyVi7dKHqr9/MhWbvhsqDYfoDApPEog2Jo=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240320122938-13a946cf3c7a/go.mod h1:DCIdeNKBJDtkkIBCyixInwFJs6rUv9PFK1U5MEH5hkY=
github.com/iotaledger/hive.go/crypto v0.0.0-20240320122938-13a946cf3c7a h1:61yy+tno2oFxsDHGtoP95S/gPmZWJMuVXYJAoHdbOF0=
github.com/iotaledger/hive.go/crypto v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:Xq2i06mX6g+NlAPMJVicwKx7FHSmIhWVS67dyxup2VU=
github.com/iotaledger/hive.go/db v0.0.0-20240315104458-b689cbcfddbd h1:JMWsW/QODcvOSxiSl3exdH93XGyPVgpnJdNd5EpQr3U=
github.com/iotaledger/hive.go/db v0.0.0-20240315104458-b689cbcfddbd/go.mod h1:8Y5vqE5NK5zG4Af0JV2UQeW67iLlymPLsT1KkOn4qY8=
github.com/iotaledger/hive.go/ds v0.0.0-20240320122938-13a946cf3c7a h1:6WKdn9mf4L0p8+QqSziSW0vOEIHLBADHEzVe0yoEwkY=
github.com/iotaledger/hive.go/ds v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:PU8vmnyWDAM7Nbl/j9pRIemNfMEO/vPQ/tN3wks55lE=
github.com/iotaledger/hive.go/ierrors v0.0.0-20240320122938-13a946cf3c7a h1:LkNT/KWU52l/YLQQO9VC+TfOap514Y6AI0LI1EvsDJA=
github.com/iotaledger/hive.go/ierrors v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:GQY0/35sjgT9Poi1Vrs9kFVvAkuKzGXfVh4j6CBXsAA=
github.com/iotaledger/hive.go/kvstore v0.0.0-20240315104458-b689cbcfddbd h1:HegZpJKGZLq0NAE1Tgxs9Y+EHC0mItpyHeodCSYgdEI=
github.com/iotaledger/hive.go/kvstore v0.0.0-20240315104458-b689cbcfddbd/go.mod h1:dCgv8YMOihhGNxQu37Vh5XqT/7wLbIJst2WePqo1z8Y=
github.com/iotaledger/hive.go/lo v0.0.0-20240320122938-13a946cf3c7a h1:OMGfUIguLzYfLVbrMeCH/1q+k+Ddam5klNTxq7WI/DM=
github.com/iotaledger/hive.go/lo v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:V6O70RMPKU1vVN1JqmLbOFeQbR11MmQha9ZboaD3q0Q=
github.com/iotaledger/hive.go/log v0.0.0-20240315104458-b689cbcfddbd h1:AzcvTlArc0zqrC/jyN7jEmsKMAFetsbXp8/ubbcLtsg=
github.com/iotaledger/hive.go/log v0.0.0-20240315104458-b689cbcfddbd/go.mod h1:H5tmswUbT3o5+QiM6UPtBv7VnPf+lJtlantgpp2lzUI=
github.com/iotaledger/hive.go/runtime v0.0.0-20240320122938-13a946cf3c7a h1:Gi3goUvvdETcAcKfikjYRtDQzqzKduRVtIGJHkffudI=
github.com/iotaledger/hive.go/runtime v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:eyKTWoVdSj6RRaaOrDLVnFuaOWUydk88ofEXHb+/Ryo=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240320122938-13a946cf3c7a h1:cPyDaEIjqN43UQLsdVO9Ma3wBj6uY5VXeuSt4SuNeQ8=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240320122938-13a946cf3c7a/go.mod h1:DVwHG6s3mWf/5NXr+CKmLXsqzLZZrhgDR2HE0ti5g7o=
github.com/iotaledger/hive.go/sql v0.0.0-20240315104458-b689cbcfddbd h1:jLUMNfEYZGx41IsXv2jjlKywzqhv0z2F7hzfDTDpbPU=
github.com/iotaledger/hive.go/sql v0.0.0-20240315104458-b689cbcfddbd/go.mod h1:O9R4vLdoSBhEO+WyEEmBHKChlD80oz9EVi7vjuxE+J8=
github.com/iotaledger/hive.go/stringify v0.0.0-20240320122938-13a946cf3c7a h1:5C2yVhObYmXJSQyEaepYCf1fG+FZ73WBCB12UGXWiE8=
github.com/iotaledger/hive.go/stringify v0.0.0-20240320122938-13a946cf3c7a/go.mod h1:O4p7UmsfoeLqtAUwrKbq0lXMxjY/MLQSpZSavvvvGig=
github.com/iotaledger/hive.go/ads v0.0.0-20240326102522-2e37ab3611a3 h1:xd0fKdbI6livsfw/UB9TXm2BjnR9PlJlSmJ2wklOU1E=
github.com/iotaledger/hive.go/ads v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:MusDtRkXqLBgANI9Wt0Fb5R2QAjxetx2xN/kduxWAGQ=
github.com/iotaledger/hive.go/app v0.0.0-20240326102522-2e37ab3611a3 h1:QiSgv50dey57Ym+Vl3Y82sQs4wvaDuf87BvbhWhjOso=
github.com/iotaledger/hive.go/app v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:pyNcvz1II6mYSc2SqrRZ5SoAzBPtezb23/crLFMntRY=
github.com/iotaledger/hive.go/constraints v0.0.0-20240326102522-2e37ab3611a3 h1:jIWLMDyeQvm3Uy1TMnKZLv+F3XgHpoQO5lfSyKSnkPs=
github.com/iotaledger/hive.go/constraints v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:JF7jjkL6tSUOXm23SWadBzBrl7eJk1DQRLc/fNoVZ+o=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240326102522-2e37ab3611a3 h1:zf1xTvU+y0Hj42IviDXrjp/Rko4u4dADpI0krisfdfU=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240326102522-2e37ab3611a3/go.mod h1:DCIdeNKBJDtkkIBCyixInwFJs6rUv9PFK1U5MEH5hkY=
github.com/iotaledger/hive.go/crypto v0.0.0-20240326102522-2e37ab3611a3 h1:rlVtaVBliAoM1i+PZtrsPuaLbFREFPcATgGX48yfvyM=
github.com/iotaledger/hive.go/crypto v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:Xq2i06mX6g+NlAPMJVicwKx7FHSmIhWVS67dyxup2VU=
github.com/iotaledger/hive.go/db v0.0.0-20240326102522-2e37ab3611a3 h1:TdIWTE76ALzxvbloV23RfHKu+7nAXhzuG7b9UtJo+jI=
github.com/iotaledger/hive.go/db v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:/85avLuBuPfUzDha0RpS+TnSHRK/2b6OvKd/k4ZA7u0=
github.com/iotaledger/hive.go/ds v0.0.0-20240326102522-2e37ab3611a3 h1:qvZYXVZPxRRaZ0EesxlLI8mlqtSdl/lttuxkoxGeZdM=
github.com/iotaledger/hive.go/ds v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:PU8vmnyWDAM7Nbl/j9pRIemNfMEO/vPQ/tN3wks55lE=
github.com/iotaledger/hive.go/ierrors v0.0.0-20240326102522-2e37ab3611a3 h1:5vlaAc8OtyKkljrncT575M+Iv2swTw7QZTmoFlb5Vzc=
github.com/iotaledger/hive.go/ierrors v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:GQY0/35sjgT9Poi1Vrs9kFVvAkuKzGXfVh4j6CBXsAA=
github.com/iotaledger/hive.go/kvstore v0.0.0-20240326102522-2e37ab3611a3 h1:D1F4NB6Z+5ng3+seCr0sucTVY+sg2BxQXrRyyYFOEOs=
github.com/iotaledger/hive.go/kvstore v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:QU3k6NxoiFnaMfgZwDLFKZKpORxYNP/T1pAxI3N/dDM=
github.com/iotaledger/hive.go/lo v0.0.0-20240326102522-2e37ab3611a3 h1:I2Yxf7hqLFMIDCmqHJw+9pe2Byt4yco6mW/+08Ez8Gw=
github.com/iotaledger/hive.go/lo v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:V6O70RMPKU1vVN1JqmLbOFeQbR11MmQha9ZboaD3q0Q=
github.com/iotaledger/hive.go/log v0.0.0-20240326102522-2e37ab3611a3 h1:D2iXKhtTsedHsQNmdH6kfbLaFHDZw9FIK6b3q/hMJXw=
github.com/iotaledger/hive.go/log v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:aGN4l8SXoKmtx8RZV+hjuRykKAJUjHW9OhkoPU5/A6A=
github.com/iotaledger/hive.go/runtime v0.0.0-20240326102522-2e37ab3611a3 h1:Qm4ieb0nUgWAl2f7uatKCaFEYxHIoN74nSfWKTXf1D0=
github.com/iotaledger/hive.go/runtime v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:5HB62balCh5K0F61kuMAPZs1HkBn95J1L+3ZFiUSn/4=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240326102522-2e37ab3611a3 h1:2JfLvc2MDwajvBa+vOmg1jRpV1l4MDLjocq6TB0ll5k=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240326102522-2e37ab3611a3/go.mod h1:DVwHG6s3mWf/5NXr+CKmLXsqzLZZrhgDR2HE0ti5g7o=
github.com/iotaledger/hive.go/sql v0.0.0-20240326102522-2e37ab3611a3 h1:vTlW9UaCwVFpXw0kVoiaTz1BFspQG+1Dl2KibtwkSTg=
github.com/iotaledger/hive.go/sql v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:qij+RLCofEiOwS1sVJO+XYK9bTDejaohYOtrIMMD/qk=
github.com/iotaledger/hive.go/stringify v0.0.0-20240326102522-2e37ab3611a3 h1:lIkipTVd8z/G+Iup64OA2CnMFjsTHpwSomw0u4tCRtc=
github.com/iotaledger/hive.go/stringify v0.0.0-20240326102522-2e37ab3611a3/go.mod h1:O4p7UmsfoeLqtAUwrKbq0lXMxjY/MLQSpZSavvvvGig=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240307101848-db58eb9353ec h1:8pasR6AxVTr1AqTbyAgPmrgmEE+Z5Tn4DOQy/Eu8jN8=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20240307101848-db58eb9353ec/go.mod h1:LrPLgC2QeGvsgyhS7SYoqH449z4C4ro4HOByg1PXqHw=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20240307100839-48553e1d2022 h1:I178SaWPhSxTvntKKvUVIdeogXIiLDALTbstKvbCuVc=
Expand Down Expand Up @@ -348,8 +349,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA=
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.5.4 h1:Xp2aQS8uXButQdnCMWNmvx6UysWQQC+u1EoizjguY+8=
github.com/jackc/pgx/v5 v5.5.4/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
Expand Down Expand Up @@ -964,12 +965,12 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/postgres v1.5.6 h1:ydr9xEd5YAM0vxVDY0X139dyzNz10spDiDlC7+ibLeU=
gorm.io/driver/postgres v1.5.6/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA=
gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM=
gorm.io/driver/postgres v1.5.7/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA=
gorm.io/driver/sqlite v1.5.5 h1:7MDMtUZhV065SilG62E0MquljeArQZNfJnjd9i9gx3E=
gorm.io/driver/sqlite v1.5.5/go.mod h1:6NgQ7sQWAIFsPrJJl1lSNSu2TABh0ZZ/zm5fosATavE=
gorm.io/gorm v1.25.7 h1:VsD6acwRjz2zFxGO50gPO6AkNs7KKnvfzUjHQhZDz/A=
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
gorm.io/gorm v1.25.8 h1:WAGEZ/aEcznN4D03laj8DKnehe1e9gYQAjW8xyPRdeo=
gorm.io/gorm v1.25.8/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/p2p/neighbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (n *neighbor) Close() {
n.logger.LogErrorf("Failed to disconnect the neighbor, error: %s", err.Error())
}
n.wg.Wait()
n.logger.UnsubscribeFromParentLogger()
n.logger.Shutdown()
}

func (n *neighbor) disconnect() (err error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (c *Chain) initLogger() (shutdown func()) {
c.IsEvicted.LogUpdates(c, log.LevelTrace, "IsEvicted"),
c.shouldEvict.LogUpdates(c, log.LevelTrace, "shouldEvict"),

c.Logger.UnsubscribeFromParentLogger,
c.Logger.Shutdown,
)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (c *Chains) initLogger(logger log.Logger) (shutdown func()) {
c.HeaviestAttestedCandidate.LogUpdates(c, log.LevelTrace, "HeaviestAttestedCandidate", (*Chain).LogName),
c.HeaviestVerifiedCandidate.LogUpdates(c, log.LevelTrace, "HeaviestVerifiedCandidate", (*Chain).LogName),

logger.UnsubscribeFromParentLogger,
logger.Shutdown,
)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (c *Commitment) initLogger() (shutdown func()) {
c.ReplayDroppedBlocks.LogUpdates(c, log.LevelTrace, "ReplayDroppedBlocks"),
c.IsEvicted.LogUpdates(c, log.LevelTrace, "IsEvicted"),

c.Logger.UnsubscribeFromParentLogger,
c.Logger.Shutdown,
)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/commitments.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c *Commitments) initLogger() (shutdown func()) {
return lo.BatchReverse(
c.Root.LogUpdates(c, log.LevelTrace, "Root", (*Commitment).LogName),

c.Logger.UnsubscribeFromParentLogger,
c.Logger.Shutdown,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewProvider() module.Provider[*engine.Engine, notarization.Notarization] {
logger := e.NewChildLogger("NotarizationManager")

m := NewManager(e.NewSubModule("NotarizationManager"), e.Workers.CreateGroup("NotarizationManager"), e.ErrorHandler("notarization"))
m.ShutdownEvent().OnTrigger(logger.UnsubscribeFromParentLogger)
m.ShutdownEvent().OnTrigger(logger.Shutdown)

m.apiProvider = e

Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/engine/tipmanager/v1/tip_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (t *TipMetadata) initLogging() {
t.weaklyOrphanedWeakParents.LogUpdates(t, logLevel, "WeaklyOrphanedWeakParents")
t.parentsReferencingLatestValidationBlock.LogUpdates(t, logLevel, "ParentsReferencingLatestValidationBlock")

t.evicted.OnTrigger(t.UnsubscribeFromParentLogger)
t.evicted.OnTrigger(t.Logger.Shutdown)
}

// initBehavior initializes the behavior of the TipMetadata.
Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func newNetwork(protocol *Protocol, networkEndpoint network.Endpoint) *Network {
protocol: protocol,
}

protocol.ShutdownEvent().OnTrigger(n.Logger.UnsubscribeFromParentLogger)
protocol.ShutdownEvent().OnTrigger(n.Logger.Shutdown)

return n
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ func New(logger log.Logger, workers *workerpool.Group, networkEndpoint network.E
p.initNetwork(),

shutdownSubComponents,

logger.Shutdown,
)

p.ShutdownEvent().OnTrigger(shutdown)
Expand Down Expand Up @@ -154,7 +156,7 @@ func (p *Protocol) initSubcomponents(networkEndpoint network.Endpoint) (shutdown
return func() {
p.Blocks.Shutdown()
p.WarpSync.Shutdown()
p.Network.Shutdown()
p.Network.Protocol.Shutdown()
p.Workers.WaitChildren()
p.Engines.ShutdownEvent().Trigger()
p.Workers.Shutdown()
Expand Down
2 changes: 1 addition & 1 deletion pkg/testsuite/mock/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (n *Node) Shutdown() {
}

<-stopped
n.logger.UnsubscribeFromParentLogger()
n.logger.Shutdown()
}

func (n *Node) ProtocolParametersHash() iotago.Identifier {
Expand Down
Loading

0 comments on commit b18b728

Please sign in to comment.