Add more log statements to site_github_munger.#189
Open
NullableInt wants to merge 6 commits intojekyll:mainfrom
Open
Add more log statements to site_github_munger.#189NullableInt wants to merge 6 commits intojekyll:mainfrom
NullableInt wants to merge 6 commits intojekyll:mainfrom
Conversation
This adds more logs that were critical for us to solve an deploy error.
MichaelCurrin
suggested changes
May 28, 2021
Contributor
MichaelCurrin
left a comment
There was a problem hiding this comment.
Update log messages
Updated with suggestions from @MichaelCurrin
Co-authored-by: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com>
| # Set `site.url` and `site.baseurl` if unset. | ||
| def add_url_and_baseurl_fallbacks! | ||
| site.config["url"] ||= Value.new("url", proc { |_c, r| r.url_without_path }) | ||
| Jekyll::GitHubMetadata.log :debug, "Adding URL and base URL fallbacks..." |
Contributor
There was a problem hiding this comment.
This describes the whole function, so some whitespace is useful, so indicate it applies to the section and not just the line or two directly after it.
Suggested change
| Jekyll::GitHubMetadata.log :debug, "Adding URL and base URL fallbacks..." | |
| Jekyll::GitHubMetadata.log :debug, "Adding URL and base URL fallbacks..." | |
| return unless should_set_baseurl? | ||
|
|
||
| site.config["baseurl"] = Value.new("baseurl", proc { |_c, r| r.baseurl }) | ||
| Jekyll::GitHubMetadata.log :debug, "baseurl is set to #{site.config["baseurl"]}" |
Contributor
There was a problem hiding this comment.
Use base URL here for consistency with the above.
Or use url and baseurl (lowercase, no spaces) throughout. With backticks or single quotes would be nice.
e.g.
"Adding `url` and `baseurl` fallbacks..."
and
"`baseurl` is set to #{site.config["baseurl"]}"
With suggestions from @MichaelCurrin
MichaelCurrin
suggested changes
Jun 1, 2021
Co-authored-by: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com>
MichaelCurrin
approved these changes
Jun 1, 2021
Contributor
MichaelCurrin
left a comment
There was a problem hiding this comment.
Thanks, changes look good
parkr
reviewed
Jan 27, 2022
| # Set `site.url` and `site.baseurl` if unset. | ||
| def add_url_and_baseurl_fallbacks! | ||
| site.config["url"] ||= Value.new("url", proc { |_c, r| r.url_without_path }) | ||
| Jekyll::GitHubMetadata.log :debug, "Adding `url` and `baseurl` fallbacks..." |
Member
There was a problem hiding this comment.
These would be better in the Value proc { } block, otherwise the benefits of using a Value (the fact that computation is deferred) is lost.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds more logs that were critical for us to solve an deploy error.
Solves #186