-
Notifications
You must be signed in to change notification settings - Fork 46
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
layout_gha for native GitHub Action logging #220
base: main
Are you sure you want to change the base?
Conversation
I have yet to add unit tests etc as I wanted to discuss the PR with you first |
@@ -12,22 +12,23 @@ namespaces_reset <- function() { | |||
|
|||
namespaces_default <- function() { | |||
has_glue <- requireNamespace("glue", quietly = TRUE) | |||
is_running_gha <- isTRUE(Sys.getenv("GITHUB_ACTIONS") == "true") && !needs_stdout() |
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.
I need to think about this one, as I can imagine (and know) folks using logger
in GHA writing outside of the GHA logs, although hopefully explicitly setting the layout as well 🤔
Anyway, this is a super cool idea, thank you! I'm traveling/teaching in the next ~48 hours, but I will definitely get back to this PR for a more detailed look on Friday.
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.
Yeah, I can imagine. Ultimatively it is your call and I understand being weary of messing up peoples current deployment. On the other hand it would be a nice quality-of-life improvement for new projects
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.
It would be nice to also support the summary log that GHA provides, but there is no existing way of specifying a job summary with logger. Is that something you have thought about, or can you see a good interface for such a functionality (maybe in a way that is broader than GHA)
For context, the GHA summary is created by writing to a separate file whose path is given as an environment variable
This is an attempt to port the functionality in https://github.com/hadley/gha to logger.
The current setup is "invasive" in the sense that if it detects you are running in gha it will default to using
layout_gha
andappender_stderr
.Since GHA has fewer log levels than logger, some are getting squashed together silently, but the title will be set to the original log level (except for
TRACE
since the gha debug logger doesn't accept a title).GHA allows you to link the log to a specific file and potential location in the file but since I haven't found a great way to reconcile this with what information logger passes along it is currently unused