-
Notifications
You must be signed in to change notification settings - Fork 130
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
[Themes] Add status codes and event methods to user logging #4605
Conversation
This comment has been minimized.
This comment has been minimized.
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1948 tests passing in 877 suites. Report generated by 🧪jest coverage report action from 581abd8 |
For status codes I went with green for any 2xx status, yellow for 3xx (redirects), and red for anything 4xx-5xx. I'm also torn on part of the logging. On every request we make a @frandiox I would love your feedback based on your original comments from the PR prior to this. Would you want padding for the Status codes to always be in line or does this seem sufficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes!
I think I would personally prefer aligning them to the right:
Request >> GET 200 /...
Request >> GET 404 /...
Request >> POST 200 /...
Request >> GET 200 /...
Request >> POST 400 /...
If we want we could do the same with Request
and Synced
. Also, to make them more similar, another possibility is moving the statuses after the path:
Request >> GET /... 200 400ms
Request >> POST /... 200 500ms
Synced >> update /layout/theme...
Request >> GET /... 404 150ms
Just a random thought, not sure if this looks any better.
cc @jamesmengo I feel you probably have a better judgement on this 😂
a6a43d3
to
7b84b2d
Compare
This is the current look which the changes Although I prefer seeing the So the only piece left is that the actions are lower cases in If needed I can probably push the action over but that makes me wonder if I should uppercase the action. |
7b84b2d
to
4e3e92c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for all the updates! I'll defer to the other reviewers for the log styles 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR, @EvilGenius13! Logs look so much better 🤩
I've left only one refactoring + unit testing suggestion, and with that we will be ready to merge :)
Although I prefer seeing the
status code
after the event method, I can see how it aligns better with theSynced >>
Loved the idea of aligning them to the right, but I strongly prefer the status codes after the event method as well 😅
Thanks again for this PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Nice work and thanks for the changes!
+1 to adding the guard condition in logRequestLine
+ Guilherme's styling suggestions before merging
b2e18d1
to
2fb5be6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @EvilGenius13! 🚀
This commit moves the logRequestLine function into a separate file and adds status codes and event methods. It grabs both get and post requests
2fb5be6
to
581abd8
Compare
WHY are these changes introduced?
Iterating on the last user logging improvements
Follow up to: #4536
Closes: https://github.com/Shopify/develop-advanced-edits/issues/359
WHAT is this pull request doing?
This PR adds more functionality to user logging when using the Dev Server.
Highlights:
logRequestLine
function into it's own util file for use in other areasPOST
requests (not including /cdn routes)Output example with changes:
How to test your changes?
Pull down the branch
Build the branch
run
theme dev
click around and watch the logs
Measuring impact
How do we know this change was effective? Please choose one:
Checklist