vdk-core: ensure early logs are available #2846
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When vdk command is started logs do not really show up until click command start getting executed. All logs before that (from plugin hooks) seemed ignored.
I couldn't figure out for sure while click_log does that.
But this changes it so that early logs can be seen on console . The log level of the early logs is controlled by LOG_LEVEL_VDK option (which control the log level of VDK logs , since early logs are really vdk logs it make sense)
By default LOG_LEVEL_VDK is WARNING, so if more verbose logs are set it should be changed to INFO.
Testing Done:
logs look like
https://gist.github.com/antoniivanov/bdd935927c1149b74944c58e96b50ee3
logs look like
https://gist.github.com/antoniivanov/afce585f8cd03ac4e09e9010dcdd2b9a
Tested also with vdk -v DEBUG ... to see debug logs show up correctly (with bot set and unset LOG_LEVEL_VDK)
Tested other commands vdk deploy, login, info that logs look like before (aka no unnecessary logs)