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

feat_: add pre login log #6285

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

feat_: add pre login log #6285

wants to merge 1 commit into from

Conversation

qfrank
Copy link
Contributor

@qfrank qfrank commented Jan 26, 2025

Change Summary:

  • Move SetupLogSettings to the end of the call chain (e.g. createAccountAndLogin / loginAccount / restoreAccountAndLogin) to ensure that logs before a successful login are written to pre_login.log
  • The pre login log currently does not support disabling (next PR will support this), the log level is the same as geth.log, but if the frontend does not set the log level, the default log level is ERROR, to ensure that pre_login.log always exists, so that in case the user cannot log in, we can obtain potentially useful error information
  • After a successful login, logs are no longer written to pre_login.log, but are redirected to geth.log
  • After logging out, logs are no longer written to geth.log, but are redirected to pre_login.log

related: status-im/status-mobile#21501

@qfrank qfrank self-assigned this Jan 26, 2025
@status-im-auto
Copy link
Member

status-im-auto commented Jan 26, 2025

Jenkins Builds

Click to see older builds (16)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 8038f84 #1 2025-01-26 09:46:42 ~4 min tests 📄log
✔️ 8038f84 #1 2025-01-26 09:48:03 ~5 min macos 📦zip
✔️ 8038f84 #1 2025-01-26 09:48:27 ~6 min windows 📦zip
✔️ 8038f84 #1 2025-01-26 09:48:29 ~6 min macos 📦zip
✔️ 8038f84 #1 2025-01-26 09:48:40 ~6 min android 📦aar
✔️ 8038f84 #1 2025-01-26 09:48:45 ~6 min ios 📦zip
✔️ 8038f84 #1 2025-01-26 09:48:50 ~6 min linux 📦zip
✖️ 8038f84 #1 2025-01-26 09:49:11 ~6 min tests-rpc 📄log
✔️ 61298b1 #2 2025-01-26 10:07:34 ~3 min windows 📦zip
✔️ 61298b1 #2 2025-01-26 10:08:14 ~4 min macos 📦zip
✔️ 61298b1 #2 2025-01-26 10:08:30 ~4 min linux 📦zip
✔️ 61298b1 #2 2025-01-26 10:08:42 ~5 min macos 📦zip
✔️ 61298b1 #2 2025-01-26 10:09:05 ~5 min ios 📦zip
✔️ 61298b1 #2 2025-01-26 10:09:51 ~6 min android 📦aar
✖️ 61298b1 #2 2025-01-26 10:10:41 ~7 min tests-rpc 📄log
✖️ 61298b1 #2 2025-01-26 10:34:14 ~30 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ce0993d #3 2025-01-27 07:03:25 ~4 min windows 📦zip
✔️ ce0993d #3 2025-01-27 07:04:20 ~5 min macos 📦zip
✔️ ce0993d #3 2025-01-27 07:04:30 ~5 min macos 📦zip
✔️ ce0993d #3 2025-01-27 07:04:34 ~5 min ios 📦zip
✔️ ce0993d #3 2025-01-27 07:04:58 ~5 min linux 📦zip
✖️ ce0993d #3 2025-01-27 07:05:12 ~6 min tests-rpc 📄log
✔️ ce0993d #3 2025-01-27 07:05:37 ~6 min android 📦aar
✔️ ce0993d #3 2025-01-27 07:29:44 ~30 min tests 📄log
✔️ 3d90b00 #4 2025-01-27 07:07:32 ~4 min windows 📦zip
✔️ 3d90b00 #4 2025-01-27 07:09:08 ~4 min macos 📦zip
✔️ 3d90b00 #4 2025-01-27 07:09:35 ~5 min macos 📦zip
✔️ 3d90b00 #4 2025-01-27 07:10:09 ~5 min ios 📦zip
✔️ 3d90b00 #4 2025-01-27 07:10:33 ~5 min linux 📦zip
✖️ 3d90b00 #4 2025-01-27 07:11:22 ~6 min tests-rpc 📄log
✔️ 3d90b00 #4 2025-01-27 07:11:52 ~6 min android 📦aar
✔️ 3d90b00 #4 2025-01-27 08:00:01 ~30 min tests 📄log

@qfrank qfrank force-pushed the feat/pre_login_log branch 2 times, most recently from 61298b1 to ce0993d Compare January 27, 2025 06:58
@qfrank qfrank force-pushed the feat/pre_login_log branch from ce0993d to 3d90b00 Compare January 27, 2025 07:01
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 13 lines in your changes missing coverage. Please review.

Project coverage is 61.82%. Comparing base (06d2419) to head (3d90b00).

Files with missing lines Patch % Lines
api/geth_backend.go 46.66% 4 Missing and 4 partials ⚠️
mobile/status.go 75.00% 2 Missing ⚠️
params/config.go 84.61% 1 Missing and 1 partial ⚠️
cmd/utils/utils.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6285      +/-   ##
===========================================
- Coverage    61.84%   61.82%   -0.02%     
===========================================
  Files          843      843              
  Lines       111287   111308      +21     
===========================================
- Hits         68823    68816       -7     
- Misses       34497    34517      +20     
- Partials      7967     7975       +8     
Flag Coverage Δ
functional 21.59% <63.15%> (-0.04%) ⬇️
unit 60.30% <43.58%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
logutils/override.go 87.87% <100.00%> (+0.37%) ⬆️
cmd/utils/utils.go 0.00% <0.00%> (ø)
mobile/status.go 9.88% <75.00%> (+0.14%) ⬆️
params/config.go 69.57% <84.61%> (+0.55%) ⬆️
api/geth_backend.go 54.15% <46.66%> (-0.08%) ⬇️

... and 39 files with indirect coverage changes

Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

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

Looks fine. However, there is a failing RPC test that needs to be fixed.

Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

@qfrank, code LGTM. I'm just missing some evidence that the default ERROR level during pre-login is not leaking any private information. Could you please verify the log Error calls are not leaking private data? If you share with me the list of Error call sites during pre login I can also double-check (as a reviewer).

@@ -2584,6 +2587,14 @@ func (b *GethStatusBackend) Logout() error {
return nil
}

func (b *GethStatusBackend) switchToPreLoginLog() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's beneficial to add a comment somewhere (could be here as a function documentation) explaining why this pre-login approach exists, otherwise the rationale will be a scattered and difficult to find in GH discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants