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_: API logging objects with zap.Any #6125

Merged
merged 2 commits into from
Nov 29, 2024
Merged

Conversation

igor-sirotin
Copy link
Collaborator

Addresses:

Description

Automatically detect if the request/response is a JSON string (which it is in most cases) and log it as object then.

Example

Before:

{
  "method": "InitializeApplication",
  "params": "{\"dataDir\":\"/Users/igorsirotin/Repositories/Status/status-desktop/Status/data/\",\"mixpanelAppId\":\"3350627\",\"mixpanelToken\":\"5c73bda2d36a9f688a5ee45641fb6775\",\"logEnabled\":true,\"logDir\":\"\",\"logLevel\":\"DEBUG\",\"apiLoggingEnabled\":true}",
  "resp": "{\"accounts\":null,\"centralizedMetricsInfo\":{\"enabled\":false,\"userConfirmed\":false}}",
  "duration": "4.534458ms"
}

After:

{
  "method": "InitializeApplication",
  "duration": "511.916µs",
  "params": {
    "apiLoggingEnabled": true,
    "dataDir": "/Users/igorsirotin/Repositories/Status/status-desktop/Status/data"
  },
  "resp": {
    "accounts": null,
    "centralizedMetricsInfo": {
      "enabled": false,
      "userConfirmed": false
    }
  }
}

@igor-sirotin igor-sirotin self-assigned this Nov 26, 2024
@igor-sirotin igor-sirotin changed the title feat_: api logging objects as zap.Any feat_: api logging objects aszap.Any Nov 26, 2024
@igor-sirotin igor-sirotin changed the title feat_: api logging objects aszap.Any feat_: API logging objects with zap.Any Nov 26, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Nov 26, 2024

Jenkins Builds

Click to see older builds (47)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 6b10e31 #1 2024-11-26 15:50:20 ~4 min tests-rpc 📄log
✔️ 6b10e31 #1 2024-11-26 15:50:37 ~5 min macos 📦zip
✔️ 6b10e31 #1 2024-11-26 15:50:48 ~5 min ios 📦zip
✔️ 6b10e31 #1 2024-11-26 15:50:56 ~5 min linux 📦zip
✔️ 6b10e31 #1 2024-11-26 15:51:36 ~6 min android 📦aar
✔️ 6b10e31 #1 2024-11-26 15:51:37 ~5 min windows 📦zip
✔️ 6b10e31 #1 2024-11-26 15:53:06 ~7 min macos 📦zip
✖️ 6b10e31 #1 2024-11-26 15:54:51 ~9 min tests 📄log
✔️ 2c29d3a #2 2024-11-26 18:34:11 ~3 min macos 📦zip
✔️ 2c29d3a #2 2024-11-26 18:35:29 ~5 min linux 📦zip
✔️ 2c29d3a #2 2024-11-26 18:35:38 ~5 min windows 📦zip
✔️ 2c29d3a #2 2024-11-26 18:36:07 ~5 min tests-rpc 📄log
✔️ 2c29d3a #2 2024-11-26 18:36:31 ~6 min ios 📦zip
✔️ 2c29d3a #2 2024-11-26 18:37:09 ~6 min android 📦aar
✔️ 2c29d3a #2 2024-11-26 18:38:40 ~8 min macos 📦zip
✖️ 2c29d3a #2 2024-11-26 19:01:00 ~30 min tests 📄log
✔️ 4f03096 #3 2024-11-28 11:25:26 ~4 min windows 📦zip
✔️ 4f03096 #3 2024-11-28 11:25:32 ~4 min macos 📦zip
✖️ 4f03096 #3 2024-11-28 11:26:40 ~5 min tests-rpc 📄log
✔️ 4f03096 #3 2024-11-28 11:26:47 ~5 min linux 📦zip
✔️ 4f03096 #3 2024-11-28 11:26:57 ~5 min ios 📦zip
✔️ 4f03096 #3 2024-11-28 11:29:14 ~7 min macos 📦zip
✔️ 4f03096 #3 2024-11-28 11:29:20 ~8 min android 📦aar
✖️ 4f03096 #3 2024-11-28 11:51:18 ~29 min tests 📄log
✔️ b352af2 #4 2024-11-28 11:42:58 ~3 min windows 📦zip
✔️ b352af2 #4 2024-11-28 11:43:10 ~4 min macos 📦zip
✔️ b352af2 #4 2024-11-28 11:44:04 ~4 min tests-rpc 📄log
✔️ b352af2 #4 2024-11-28 11:44:50 ~5 min linux 📦zip
✔️ b352af2 #4 2024-11-28 11:44:58 ~5 min android 📦aar
✔️ b352af2 #4 2024-11-28 11:45:47 ~6 min ios 📦zip
✔️ b352af2 #4 2024-11-28 11:47:04 ~7 min macos 📦zip
✖️ b352af2 #4 2024-11-28 12:20:08 ~28 min tests 📄log
7c6b33f #5 2024-11-28 23:42:46 ~4 min ios 📄log
7c6b33f #5 2024-11-28 23:43:17 ~5 min macos 📄log
✔️ 7c6b33f #5 2024-11-28 23:43:44 ~5 min tests-rpc 📄log
✔️ 7c6b33f #5 2024-11-28 23:43:55 ~5 min windows 📦zip
✔️ 7c6b33f #5 2024-11-28 23:45:13 ~7 min linux 📦zip
✔️ 7c6b33f #5 2024-11-28 23:45:27 ~7 min android 📦aar
✔️ 7c6b33f #5 2024-11-28 23:46:47 ~8 min macos 📦zip
✖️ 7c6b33f #5 2024-11-29 00:08:33 ~30 min tests 📄log
✔️ 7c6b33f #6 2024-11-29 11:47:36 ~4 min windows 📦zip
✔️ 7c6b33f #6 2024-11-29 11:48:44 ~5 min macos 📦zip
✔️ 7c6b33f #6 2024-11-29 11:48:57 ~5 min tests-rpc 📄log
✔️ 7c6b33f #6 2024-11-29 11:49:06 ~5 min linux 📦zip
✔️ 7c6b33f #6 2024-11-29 11:49:38 ~6 min android 📦aar
✔️ 7c6b33f #6 2024-11-29 11:50:17 ~6 min ios 📦zip
✔️ 7c6b33f #6 2024-11-29 11:51:37 ~8 min macos 📦zip
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e78b2e1 #7 2024-11-29 11:52:05 ~4 min windows 📦zip
✔️ e78b2e1 #7 2024-11-29 11:54:08 ~5 min macos 📦zip
✔️ e78b2e1 #7 2024-11-29 11:54:38 ~5 min tests-rpc 📄log
✔️ e78b2e1 #7 2024-11-29 11:54:55 ~5 min linux 📦zip
✔️ e78b2e1 #7 2024-11-29 11:57:24 ~7 min android 📦aar
✔️ e78b2e1 #7 2024-11-29 11:58:50 ~8 min ios 📦zip
✔️ e78b2e1 #7 2024-11-29 11:59:01 ~7 min macos 📦zip
✖️ e78b2e1 #7 2024-11-29 12:19:20 ~30 min tests 📄log
✔️ ab422dc #8 2024-11-29 12:45:53 ~4 min windows 📦zip
✔️ ab422dc #8 2024-11-29 12:46:51 ~5 min tests-rpc 📄log
✔️ ab422dc #8 2024-11-29 12:46:56 ~5 min macos 📦zip
✔️ ab422dc #8 2024-11-29 12:47:08 ~5 min ios 📦zip
✔️ ab422dc #8 2024-11-29 12:47:28 ~5 min linux 📦zip
✔️ ab422dc #8 2024-11-29 12:47:53 ~6 min android 📦aar
✔️ ab422dc #8 2024-11-29 12:49:11 ~7 min macos 📦zip
✔️ ab422dc #8 2024-11-29 13:11:40 ~30 min tests 📄log

@igor-sirotin igor-sirotin force-pushed the feat/api-logging-objects branch from 6b10e31 to 2c29d3a Compare November 26, 2024 18:29
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.

Noice

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.95%. Comparing base (e477269) to head (ab422dc).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6125      +/-   ##
===========================================
- Coverage    60.97%   60.95%   -0.02%     
===========================================
  Files          827      827              
  Lines       109747   109753       +6     
===========================================
- Hits         66915    66905      -10     
- Misses       34988    35006      +18     
+ Partials      7844     7842       -2     
Flag Coverage Δ
functional 14.13% <0.00%> (-0.04%) ⬇️
unit 59.96% <100.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
mobile/callog/status_request_log.go 87.30% <100.00%> (+1.33%) ⬆️

... and 29 files with indirect coverage changes

@igor-sirotin igor-sirotin force-pushed the feat/InitializeApplication-init-logs branch from 42772eb to e30c6aa Compare November 28, 2024 11:17
@igor-sirotin igor-sirotin force-pushed the feat/api-logging-objects branch 2 times, most recently from b352af2 to 7c6b33f Compare November 28, 2024 23:37
Base automatically changed from feat/InitializeApplication-init-logs to develop November 29, 2024 11:43
@igor-sirotin igor-sirotin force-pushed the feat/api-logging-objects branch from 7c6b33f to e78b2e1 Compare November 29, 2024 11:44
@igor-sirotin igor-sirotin merged commit cdc41c3 into develop Nov 29, 2024
18 checks passed
@igor-sirotin igor-sirotin deleted the feat/api-logging-objects branch November 29, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants