Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(logging)_: default waku node logs to INFO level #6164

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

osmaczko
Copy link
Contributor

@osmaczko osmaczko commented Dec 3, 2024

This ensures waku node logs remain at INFO level, even if the global
logging level is set lower (e.g. DEBUG). To enable waku logs at a
specific level, one can execute:
wakuext_setLogNamespaces([{"logNamespaces": "wakunode:debug"}]).

iterates: status-im/status-desktop#16511

@osmaczko osmaczko self-assigned this Dec 3, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Dec 3, 2024

Jenkins Builds

Click to see older builds (49)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 3cf7dc7 #1 2024-12-03 23:04:27 ~4 min macos 📦zip
✔️ 3cf7dc7 #1 2024-12-03 23:04:52 ~4 min ios 📦zip
✔️ 3cf7dc7 #1 2024-12-03 23:04:57 ~5 min linux 📦zip
✔️ 3cf7dc7 #1 2024-12-03 23:05:55 ~5 min windows 📦zip
✔️ 3cf7dc7 #1 2024-12-03 23:05:59 ~6 min android 📦aar
✔️ 3cf7dc7 #1 2024-12-03 23:06:06 ~6 min tests-rpc 📄log
✔️ 3cf7dc7 #1 2024-12-03 23:09:06 ~9 min macos 📦zip
✔️ 3cf7dc7 #1 2024-12-03 23:30:29 ~30 min tests 📄log
✔️ 0148d3d #2 2024-12-04 10:33:49 ~4 min macos 📦zip
✔️ 0148d3d #2 2024-12-04 10:34:28 ~4 min windows 📦zip
✔️ 0148d3d #2 2024-12-04 10:35:46 ~6 min ios 📦zip
✔️ 0148d3d #2 2024-12-04 10:36:19 ~6 min linux 📦zip
✔️ 0148d3d #2 2024-12-04 10:36:48 ~7 min android 📦aar
✔️ 0148d3d #2 2024-12-04 10:37:36 ~8 min tests-rpc 📄log
✔️ 0148d3d #2 2024-12-04 10:37:50 ~8 min macos 📦zip
✖️ 0148d3d #2 2024-12-04 11:00:26 ~30 min tests 📄log
✔️ 566e9e1 #3 2024-12-04 11:14:19 ~4 min macos 📦zip
✔️ 566e9e1 #3 2024-12-04 11:14:47 ~5 min linux 📦zip
✔️ 566e9e1 #3 2024-12-04 11:15:34 ~5 min windows 📦zip
✔️ 566e9e1 #3 2024-12-04 11:15:39 ~5 min ios 📦zip
✔️ 566e9e1 #3 2024-12-04 11:17:09 ~7 min android 📦aar
✔️ 566e9e1 #3 2024-12-04 11:18:13 ~8 min macos 📦zip
✔️ 566e9e1 #3 2024-12-04 11:19:12 ~9 min tests-rpc 📄log
✖️ 566e9e1 #3 2024-12-04 11:39:44 ~29 min tests 📄log
✔️ 566e9e1 #4 2024-12-04 12:30:41 ~28 min tests 📄log
✖️ 0338f04 #5 2024-12-04 18:09:22 ~1 min tests 📄log
✖️ 0338f04 #6 2024-12-04 18:11:16 ~1 min tests 📄log
✔️ 0338f04 #4 2024-12-04 18:12:33 ~4 min windows 📦zip
✔️ 0338f04 #4 2024-12-04 18:12:39 ~5 min ios 📦zip
✔️ 0338f04 #4 2024-12-04 18:12:50 ~5 min macos 📦zip
✔️ 0338f04 #4 2024-12-04 18:13:23 ~5 min linux 📦zip
✖️ 0338f04 #4 2024-12-04 18:14:02 ~6 min tests-rpc 📄log
✔️ 0338f04 #4 2024-12-04 18:14:35 ~7 min android 📦aar
✔️ 0338f04 #5 2024-12-04 18:16:37 ~4 min windows 📦zip
✔️ 0338f04 #4 2024-12-04 18:16:39 ~9 min macos 📦zip
✔️ 0338f04 #5 2024-12-04 18:17:37 ~4 min macos 📦zip
✔️ 0338f04 #5 2024-12-04 18:18:49 ~6 min ios 📦zip
✔️ 0338f04 #5 2024-12-04 18:19:02 ~5 min linux 📦zip
✖️ 0338f04 #5 2024-12-04 18:19:48 ~5 min tests-rpc 📄log
✔️ 0338f04 #5 2024-12-04 18:21:05 ~6 min android 📦aar
✔️ 0338f04 #5 2024-12-04 18:24:38 ~7 min macos 📦zip
✔️ 0338f04 #6 2024-12-05 14:24:10 ~4 min ios 📦zip
✔️ 0338f04 #6 2024-12-05 14:24:19 ~4 min macos 📦zip
✔️ 0338f04 #6 2024-12-05 14:25:26 ~5 min windows 📦zip
✔️ 0338f04 #6 2024-12-05 14:25:30 ~5 min linux 📦zip
✔️ 0338f04 #6 2024-12-05 14:25:43 ~5 min tests-rpc 📄log
✔️ 0338f04 #6 2024-12-05 14:26:00 ~6 min android 📦aar
✔️ 0338f04 #6 2024-12-05 14:29:24 ~9 min macos 📦zip
✔️ 0338f04 #7 2024-12-05 14:48:36 ~28 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c7e3c34 #7 2024-12-05 19:36:10 ~4 min ios 📦zip
✔️ c7e3c34 #7 2024-12-05 19:36:16 ~4 min windows 📦zip
✔️ c7e3c34 #7 2024-12-05 19:36:18 ~4 min macos 📦zip
✔️ c7e3c34 #7 2024-12-05 19:37:41 ~5 min linux 📦zip
✔️ c7e3c34 #7 2024-12-05 19:38:14 ~6 min android 📦aar
✔️ c7e3c34 #7 2024-12-05 19:38:24 ~6 min tests-rpc 📄log
✔️ c7e3c34 #7 2024-12-05 19:41:40 ~9 min macos 📦zip
✔️ c7e3c34 #8 2024-12-05 20:01:36 ~29 min tests 📄log
✔️ 61c9e83 #8 2024-12-06 11:13:27 ~4 min windows 📦zip
✔️ 61c9e83 #8 2024-12-06 11:14:07 ~4 min macos 📦zip
✔️ 61c9e83 #8 2024-12-06 11:14:20 ~5 min ios 📦zip
✔️ 61c9e83 #8 2024-12-06 11:15:08 ~5 min linux 📦zip
✔️ 61c9e83 #8 2024-12-06 11:15:42 ~6 min android 📦aar
✔️ 61c9e83 #8 2024-12-06 11:15:43 ~6 min tests-rpc 📄log
✔️ 61c9e83 #8 2024-12-06 11:19:15 ~9 min macos 📦zip
✔️ 61c9e83 #9 2024-12-06 11:38:49 ~29 min tests 📄log

@@ -200,7 +200,7 @@ func (d *DBStore) Query(query *storepb.HistoryQuery) (*storepb.Index, []gowakuPe
start := time.Now()
defer func() {
elapsed := time.Since(start)
d.log.Info(fmt.Sprintf("Loading records from the DB took %s", elapsed))
d.log.Debug(fmt.Sprintf("Loading records from the DB took %s", elapsed))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
d.log.Debug(fmt.Sprintf("Loading records from the DB took %s", elapsed))
d.log.Debug("loaded records from DB", zap.Duration("duration", elapsed))

wakuv2/waku.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.96%. Comparing base (50933aa) to head (61c9e83).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
wakuv2/waku.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6164       +/-   ##
============================================
+ Coverage    13.90%   60.96%   +47.05%     
============================================
  Files          817      832       +15     
  Lines       108265   109836     +1571     
============================================
+ Hits         15054    66959    +51905     
+ Misses       91290    35042    -56248     
- Partials      1921     7835     +5914     
Flag Coverage Δ
functional 13.90% <40.00%> (+<0.01%) ⬆️
unit 60.08% <60.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
wakuv2/message_publishing.go 83.07% <100.00%> (+33.84%) ⬆️
wakuv2/waku.go 68.77% <50.00%> (+22.58%) ⬆️

... and 650 files with indirect coverage changes

@osmaczko osmaczko force-pushed the chore/reduce-waku-logs-spam branch 2 times, most recently from 0148d3d to 566e9e1 Compare December 4, 2024 11:09
logutils/override.go Outdated Show resolved Hide resolved
@osmaczko osmaczko force-pushed the chore/reduce-waku-logs-spam branch from 566e9e1 to 0338f04 Compare December 4, 2024 18:07
@osmaczko osmaczko changed the base branch from develop to feat/integrate-categorized-logging December 4, 2024 18:07
@osmaczko osmaczko changed the title chore(logging)_: avoid logging spam by 3rd parties chore(logging)_: default waku node logs to INFO level Dec 4, 2024
Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@richard-ramos
Copy link
Member

cc: @ilmotta as it's gonna be necessary to add a checkbox or something in mobile to enable waku debug level logs with wakuext_setLogNamespaces.

@@ -289,7 +289,7 @@ func New(nodeKey *ecdsa.PrivateKey, fleet string, cfg *Config, logger *zap.Logge
node.WithConnectionNotification(waku.connectionNotifChan),
node.WithTopicHealthStatusChannel(waku.topicHealthStatusChan),
node.WithKeepAlive(randomPeersKeepAliveInterval, allPeersKeepAliveInterval),
node.WithLogger(logger),
node.WithLogger(logger.Named("wakunode")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to refer to namespaces we need to hardcode using constants.

@ilmotta
Copy link
Contributor

ilmotta commented Dec 4, 2024

Issue created for Mobile status-im/status-mobile#21758. Thanks for tagging me @richard-ramos

Base automatically changed from feat/integrate-categorized-logging to develop December 5, 2024 14:19
@osmaczko osmaczko force-pushed the chore/reduce-waku-logs-spam branch from 0338f04 to c7e3c34 Compare December 5, 2024 19:31
This ensures waku node logs remain at INFO level, even if the global
logging level is set lower (e.g. DEBUG). To enable waku logs at a
specific level, one can execute:
`wakuext_setLogNamespaces([{"logNamespaces": "wakunode:debug"}])`.

iterates: status-im/status-desktop#16511
@osmaczko osmaczko force-pushed the chore/reduce-waku-logs-spam branch from c7e3c34 to 61c9e83 Compare December 6, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review
Development

Successfully merging this pull request may close these issues.

6 participants