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(logging)_: enable runtime logs configuration #6210

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

Conversation

osmaczko
Copy link
Contributor

Add endpoints for log level and namespaces configuration to status.go and deprecate equivalents from service.

Endpoints are defined in status.go, as it has access to statusBackend, the only entity capable of manipulating node configuration without requiring a restart.

Add endpoints for log level and namespaces configuration to
`status.go` and deprecate equivalents from service.

Endpoints are defined in `status.go`, as it has access to
`statusBackend`, the only entity capable of manipulating node
configuration without requiring a restart.
@osmaczko osmaczko self-assigned this Dec 12, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Dec 12, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7c70372 #1 2024-12-12 20:07:31 ~4 min linux 📦zip
✔️ 7c70372 #1 2024-12-12 20:07:33 ~4 min macos 📦zip
✔️ 7c70372 #1 2024-12-12 20:07:41 ~4 min ios 📦zip
✔️ 7c70372 #1 2024-12-12 20:08:35 ~5 min android 📦aar
✔️ 7c70372 #1 2024-12-12 20:08:41 ~5 min windows 📦zip
✔️ 7c70372 #1 2024-12-12 20:08:46 ~5 min macos 📦zip
✔️ 7c70372 #1 2024-12-12 20:09:43 ~6 min tests-rpc 📄log
✔️ 7c70372 #1 2024-12-12 20:34:56 ~31 min tests 📄log

@osmaczko
Copy link
Contributor Author

Functional test results:

Running pytest with args: ['-p', 'vscode_pytest', '--status_backend_urls=http://localhost:42995', '--rootdir=/path/to/status-go/tests-functional', '/path/to/status-go/tests-functional/tests/test_logging.py::TestLogging::test_logging']
============================= test session starts ==============================
platform linux -- Python 3.11.9, pytest-6.2.4, py-1.11.0, pluggy-0.13.1 -- /bin/python
cachedir: .pytest_cache
rootdir: /path/to/status-go/tests-functional, configfile: pytest.ini
plugins: dependency-0.6.0
collecting ... collected 1 item

tests/test_logging.py::TestLogging::test_logging 
-------------------------------- live log call ---------------------------------
INFO     root:status_backend.py:39 Sending POST request to url http://localhost:42995/statusgo/InitializeApplication with data: {
    "apiLogging": true,
    "dataDir": "/tmp/pytest-of-myself/pytest-85/test_logging0",
    "logEnabled": true,
    "logLevel": "DEBUG"
}
INFO     root:signals.py:121 Connection opened
WARNING  websocket:_logging.py:66 websocket connected
INFO     root:status_backend.py:41 Got response: b'{"accounts":null,"centralizedMetricsInfo":{"enabled":false,"userConfirmed":false}}'
INFO     root:status_backend.py:47 Got response: b'{"accounts":null,"centralizedMetricsInfo":{"enabled":false,"userConfirmed":false}}'
INFO     root:status_backend.py:39 Sending POST request to url http://localhost:42995/statusgo/CreateAccountAndLogin with data: {
    "customizationColor": "primary",
    "displayName": "Mr_Meeseeks",
    "kdfIterations": 256000,
    "logEnabled": true,
    "logLevel": "DEBUG",
    "password": "Strong12345",
    "rootDataDir": "/tmp/pytest-of-myself/pytest-85/test_logging0"
}
INFO     root:status_backend.py:41 Got response: b'{"error":""}'
INFO     root:status_backend.py:47 Got response: b'{"error":""}'
INFO     root:status_backend.py:39 Sending POST request to url http://localhost:42995/statusgo/SetLogLevel with data: {
    "logLevel": "ERROR"
}
INFO     root:status_backend.py:41 Got response: b'{"error":""}'
INFO     root:status_backend.py:47 Got response: b'{"error":""}'
INFO     root:status_backend.py:39 Sending POST request to url http://localhost:42995/statusgo/SetLogNamespaces with data: {
    "logNamespaces": "test1.test2:debug,test1.test2.test3:info"
}
INFO     root:status_backend.py:41 Got response: b'{"error":""}'
INFO     root:status_backend.py:47 Got response: b'{"error":""}'
INFO     root:rpc.py:54 Sending POST request to url http://localhost:42995/statusgo/CallRPC with data: {
    "id": null,
    "jsonrpc": "2.0",
    "method": "wakuext_logTest"
}
INFO     root:rpc.py:58 Got response: {
    "id": null,
    "jsonrpc": "2.0",
    "result": null
}
INFO     root:status_backend.py:39 Sending POST request to url http://localhost:42995/statusgo/Logout with data: {}
INFO     root:status_backend.py:41 Got response: b'{"error":""}'
INFO     root:status_backend.py:47 Got response: b'{"error":""}'
INFO     root:status_backend.py:39 Sending POST request to url http://localhost:42995/statusgo/LoginAccount with data: {
    "kdfIterations": 256000,
    "keyUid": "0x42d81d7344e88629b9bf94536a732680683a8a0f42d1422cf8f24a0b5699bdb7",
    "password": "Strong12345"
}
INFO     root:status_backend.py:41 Got response: b'{"error":""}'
INFO     root:status_backend.py:47 Got response: b'{"error":""}'
INFO     root:rpc.py:54 Sending POST request to url http://localhost:42995/statusgo/CallRPC with data: {
    "id": null,
    "jsonrpc": "2.0",
    "method": "wakuext_logTest"
}
INFO     root:rpc.py:58 Got response: {
    "id": null,
    "jsonrpc": "2.0",
    "result": null
}
PASSED

============================== 1 passed in 12.55s ==============================
Finished running tests!

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 15.21739% with 39 lines in your changes missing coverage. Please review.

Project coverage is 61.24%. Comparing base (74db631) to head (7c70372).

Files with missing lines Patch % Lines
mobile/status.go 0.00% 23 Missing ⚠️
api/geth_backend.go 0.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6210      +/-   ##
===========================================
- Coverage    61.27%   61.24%   -0.03%     
===========================================
  Files          833      833              
  Lines       109910   109949      +39     
===========================================
- Hits         67348    67340       -8     
- Misses       34711    34757      +46     
- Partials      7851     7852       +1     
Flag Coverage Δ
functional 19.34% <13.04%> (+<0.01%) ⬆️
unit 60.04% <15.21%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
logutils/core.go 87.27% <100.00%> (+0.23%) ⬆️
params/config.go 69.43% <100.00%> (+0.41%) ⬆️
protocol/messenger_settings.go 25.80% <ø> (ø)
api/geth_backend.go 53.59% <0.00%> (-0.65%) ⬇️
mobile/status.go 10.00% <0.00%> (-0.18%) ⬇️

... and 34 files with indirect coverage changes

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.

2 participants