-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
new register_handlers function #73
Conversation
Note to myself: this still requires some thinking. Both testthat2 as well as R CMD BUILD doesn't like this functionality and fail with the following: |
Code Coverage Summary
Diff against main
Results for commit: d99e6c6 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 3 suites 0s ⏱️ Results for commit d99e6c6. ♻️ This comment has been updated with latest results. |
Re: this. It's not super easy to identify when it's forbidden. After additional research I have found out that also pkgdown complains about this (so it's not only build and test). Therefore it would be difficult to specify a condition when this could be safely called. I decided to introduce a try block instead (and document it accordingly). This is not a solution that I am super proud of but it does the trick. |
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.
teal.goshawk
and tmh still have logger::log_info
feel free to create an issue and put it to our backlog if you have too much to do now
I got it covered. Please have a look at the parent issue. It has all the PRs linked so it's easily findable. UPDATE: actually they are also linked here in the top-message as well |
Hi @gogonzo
An example (with not pushed test functions):
|
Co-authored-by: Dawid Kałędkowski <[email protected]> Signed-off-by: Pawel Rucki <[email protected]>
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 addressing my old issue. I've tested on teal.gallery apps, everything looks good. Only this "plotly warning" somehow gets through - I hope someday we will get rid of this ;)
Signed-off-by: Pawel Rucki <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 --------- Signed-off-by: Pawel Rucki <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 I will keep it as a draft for the time being because this requires (currently) development version of `teal.logger`. This has impact on our release plan as `teal.logger` would have to be released first --------- Signed-off-by: Pawel Rucki <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 --------- Signed-off-by: Pawel Rucki <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 --------- Signed-off-by: Pawel Rucki <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 As a bonus, we can safely move `logger` to suggests (it's still used in tests) --------- Signed-off-by: Pawel Rucki <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 As a bonus, we can safely move `logger` to suggests (it's still used in tests) --------- Signed-off-by: Pawel Rucki <[email protected]> Co-authored-by: Dony Unardi <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 As a bonus, we can safely remove `logger` --------- Signed-off-by: Pawel Rucki <[email protected]> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Marcin <[email protected]>
close insightsengineering/coredev-tasks#502 test with insightsengineering/teal.logger#73 As a bonus, we can safely move `logger` to suggests (it's still used in tests) --------- Signed-off-by: Pawel Rucki <[email protected]>
close https://github.com/insightsengineering/coredev-tasks/issues/502 #69
I tried to use
logger::log_messages()
(and similar functions for warnings and errors) but I have encounter following problems:teal
e.g.Therefore I have decided to implement own register handlers mechanism. I initially started doing this separately inside each package but then I realised that it's not so DRY and decided to extend core
teal.logger
functionality.This is not a reprex as I modified
teal
andteal.slice
namespaces in a following way:register_handlers(<pkg>)
in both packagesteal.slice
:teal_s_message
callingmessage()
teal_s_warning
callingwarning()
teal_s_stop
callingstop()
teal
:teal_message
callingmessage()
teal_warning
callingwarning()
teal_stop
callingstop()
teal_message_nested
callingteal_s_message()
(so as to simulateteal
callingteal.slice
)teal_warning_nested
callingteal_s_warning()
teal_stop_nested
callingteal_s_stop()
The outcome:
Interpretation (where "m/w/s" stands for "message / warning / stop"):
PRs:
(I'll keep them as draft as this is conflicting with release plans because teal.logger would have to be released first)
TODO: tests - however I'm not yet sure how to make them "clean"