Repository navigation
[Proposal] Implement lifecycle print cli option - #7658
fredericbarthelet wants to merge 3 commits into
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7658 +/- ##
==========================================
- Coverage 88.00% 87.70% -0.30%
==========================================
Files 245 245
Lines 9202 9242 +40
==========================================
+ Hits 8098 8106 +8
- Misses 1104 1136 +32
Continue to review full report at Codecov.
|
medikoo
left a comment
There was a problem hiding this comment.
@fredericbarthelet great thanks for that proposal!
Nonetheless I believe this should be solved by improving log engine with log namespaces and levels
e.g. then you can ensure similar output by providing LOG_DEBUG=serverless:lifecycle env var
There's dedicated #1720 issue, for which PR is very welcome
|
@fredericbarthelet with v3 we've introduced a level based logger, and with efe1139 I've just configured basic debug logs that list triggered hooks. It's released with v3.4.0, logs will be exposed when adding If you feel it can be improve, feel free to propose a PR :) |
What did you implement
Added a
LOG_DEBUG=serverless:lifecyclecli option to every serverless commands displaying commands, events and sub-sequent hooks triggered by that command.I felt the need for such a command when developing a Serverless plugin. This helped me figure out which event I should hook to in order to run the plugin code at the optimal time.
The screenshot (color choices, format) is really not pretty at the moment. I was looking for feedback towards the pros&cons of such a feature.
How can we verify it
Simply checkout on this branch and run
LOG_DEBUG=serverless:lifecycle serverless deploywithin any serverless project root directory.Todos
Useful Scripts
npm run test:ci--> Run all validation checks on proposed changesnpm run lint:updated--> Lint all the updated filesnpm run lint:fix--> Automatically fix lint problems (if possible)npm run prettier-check:updated--> Check if updated files adhere to Prettier confignpm run prettify:updated--> Prettify all the updated filesIs this ready for review?: YES
Is it a breaking change?: NO