-
Notifications
You must be signed in to change notification settings - Fork 2
TECH-4252: support native add for broadcast #14
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
Changes from all commits
4b74773
c28cf65
e791adf
9e38103
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,23 @@ | ||||||||||||||||||
# CHANGELOG for `contextual_logger` | ||||||||||||||||||
|
||||||||||||||||||
Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||||||||||||||||||
|
||||||||||||||||||
Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||||||||||||||||||
|
||||||||||||||||||
## [0.5.1] - 2019-03-10 [diff](https://github.com/Invoca/contextual_logger/compare/v0.5.0...0.5.1) | ||||||||||||||||||
|
||||||||||||||||||
### Changed | ||||||||||||||||||
|
||||||||||||||||||
- Refactored debug, info, error... etc methods to call the base class `add(severity, message, progrname)` method since | ||||||||||||||||||
ActiveSupport::Logger.broadcast reimplements that to broadcast to multiple logger instances, such as | ||||||||||||||||||
Rails::Server logging to `STDOUT` + `development.log`. | ||||||||||||||||||
Note that the base class `add()` does not have a `context` hash like our `add()` does. | ||||||||||||||||||
We use the `**` splat to match the `context` hash up to the extra | ||||||||||||||||||
`**context` argument, if present. If that argument is not present (such as with `broadcast`), Ruby will instead | ||||||||||||||||||
match the `**context` up to the `progname` argument. | ||||||||||||||||||
|
||||||||||||||||||
## [0.5] - 2019-03-06 [diff](https://github.com/Invoca/contextual_logger/compare/v0.4.0...v0.5.0) | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keepachangelog.com shows a neat way of doing this in their CHANGELOG... It would look like this:
Suggested change
i.e. It allows for in-line more readable lines that reference to defined links at the bottom of the file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't we prefer the version to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, while they're equivalent, I agree that the extra .0 is more clear... so I've added it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I thought There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah i think I might know where confusion is coming in here. The original spec is using reference style linking for the version headers. By making the headers the version number with surrounding brackets (ex. You can see this in action when you look at the raw markdown of the spec example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, ok, I didn't know about that notation. That explains why the links are at the bottom of the source. But that seems needlessly complex to manage (add your new version to the top of the file, but don't forget to go near the bottom to add the supporting reference links... and make sure the version numbers are named exactly the same [see 0.5 vs. 0.5.0] so markdown can join them up). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's also dry. If for any reason there is the need to reference an older version, and you'd like to specifically link to it, you simply add brackets around the version number and this turns it into the same link.
The versions in the headers should be following semver, so it shouldn't be too much to keep them in sync. In semver
I completely agree. And that's exactly why the diff is added as a hyperlink and pushed out of the way in the markdown. The diff is unimportant and supplementary if anything. So it's made sure to be completely out of the way when reading the rendered markdown (through the use of a link), or reading the raw markdown (by using link reference notation). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Nah, you can't count hypothetical future cases as a DRY plus today. (YAGNI) Today it's actually less DRY, because you need to repeat the version numbers in order for the join to work. For example, when I renamed 0.5 to 0.5.0 it would have been easy to not remember to go to the bottom of the file and rename there too.
I didn't realize that "pseudo versions" were a formal concept. I know about those in the Gemfile version matchers like Doesn't this apply one level deeper? Aren't 0.5.1.0 and 0.5.1 the same version? I don't think you addressed my "discoverability" comment. How would you expect a reader to know that the version hyperlink goes to a raw github diff? I expected it to go to exactly that version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All and all, I think that we should follow the standard. If we done, you should remove the reference to the standard from the Changelog. It's more confusing to say "We follow X standard" and then change it. |
||||||||||||||||||
|
||||||||||||||||||
### Added | ||||||||||||||||||
- Extracted normalize_log_level to a public class method so we can call it elsewhere where we allow log_level to be | ||||||||||||||||||
configured to text values like 'debug'. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
contextual_logger (0.5.0) | ||
contextual_logger (0.5.1) | ||
activesupport | ||
json | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.