activesupport-broadcast_logger 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +1 -0
- data/CHANGELOG.md +18 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/CONTRIBUTING.md +106 -0
- data/LICENSE.txt +22 -0
- data/README.md +274 -0
- data/SECURITY.md +13 -0
- data/lib/activesupport/broadcast_logger/version.rb +9 -0
- data/lib/activesupport/broadcast_logger.rb +221 -0
- data/lib/activesupport-broadcast_logger.rb +43 -0
- data.tar.gz.sig +0 -0
- metadata +422 -0
- metadata.gz.sig +4 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cb0e1ac5be1a5fb65479039c4cac1767b564bd5102795fc4ca68433f205955b9
|
4
|
+
data.tar.gz: 07e5c799cadad9c26caec95421133a8630b6d74d8b115d446aee58d079bbf958
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ba35666c2c64378d748e21d8786f0a4e7ad3ebf6024011469bec1536fb69f146720cf7e249840e51d50c7c2369c71a8a0186d8a61afdd678a23e705d8c6fd33c
|
7
|
+
data.tar.gz: a13f0f3ba747dadd6a0be64390a7c279b5fc43e79cd50128922ca6257f07b956401663ea3d97ad2c4d25faa5c09e2b397e0a1ca367789635c380aeb16b7fd0a1
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/�6WU�ҳ���U-� @��z�c�s�~su!$�Ѱ��;=����=��u�t���c��8P�%� '@� Y1X���Eңi|�k!��i��,�-t%�Ŏ��y���`���L7�������
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
Since version 2.0.0, the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
### Added
|
9
|
+
### Changed
|
10
|
+
### Fixed
|
11
|
+
### Removed
|
12
|
+
|
13
|
+
## [2.0.0] - 2024-11-21
|
14
|
+
- COVERAGE: 97.06% -- 66/68 lines in 3 files
|
15
|
+
- BRANCH COVERAGE: 90.00% -- 9/10 branches in 3 files
|
16
|
+
- 73.68% documented
|
17
|
+
### Added
|
18
|
+
- Initial release
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at peter.boling@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
## Contributing
|
2
|
+
|
3
|
+
Bug reports and pull requests are welcome on GitHub at [https://github.com/pboling/activesupport-broadcast_logger][🚎src-main]
|
4
|
+
. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
|
5
|
+
the [code of conduct][🤝conduct].
|
6
|
+
|
7
|
+
To submit a patch, please fork the project and create a patch with tests.
|
8
|
+
Once you're happy with it send a pull request.
|
9
|
+
|
10
|
+
## You can help!
|
11
|
+
|
12
|
+
Take a look at the `reek` list which is the file called `REEK` and find something to improve.
|
13
|
+
|
14
|
+
Simply follow these instructions:
|
15
|
+
|
16
|
+
1. Fork the repository
|
17
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
18
|
+
3. Make some fixes.
|
19
|
+
4. Commit your changes (`git commit -am 'Added some feature'`)
|
20
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
21
|
+
6. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
22
|
+
7. Create new Pull Request.
|
23
|
+
|
24
|
+
## Contributors
|
25
|
+
|
26
|
+
Your picture could be here!
|
27
|
+
|
28
|
+
[![Contributors][🖐contributors-img]][🖐contributors]
|
29
|
+
|
30
|
+
Made with [contributors-img][🖐contrib-rocks].
|
31
|
+
|
32
|
+
## The Reek List
|
33
|
+
|
34
|
+
To refresh the `reek` list:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
bundle exec reek > REEK
|
38
|
+
```
|
39
|
+
|
40
|
+
## Appraisal
|
41
|
+
|
42
|
+
### Generate a new set of Appraisal gemfiles:
|
43
|
+
|
44
|
+
```bash
|
45
|
+
BUNDLE_GEMFILE=Appraisal.root.gemfile appraisal update
|
46
|
+
```
|
47
|
+
|
48
|
+
## Run Tests
|
49
|
+
|
50
|
+
```bash
|
51
|
+
bundle exec rake test
|
52
|
+
```
|
53
|
+
|
54
|
+
## Lint It
|
55
|
+
|
56
|
+
Run all the default tasks, which includes running the gradually autocorrecting linter, `rubocop-gradual`.
|
57
|
+
|
58
|
+
```bash
|
59
|
+
bundle exec rake
|
60
|
+
```
|
61
|
+
|
62
|
+
Or just run the linter.
|
63
|
+
```bash
|
64
|
+
bundle exec rubocop_gradual:autocorrect
|
65
|
+
```
|
66
|
+
|
67
|
+
## Release
|
68
|
+
|
69
|
+
### One-time, Per-developer, Setup
|
70
|
+
|
71
|
+
**IMPORTANT**: Your public key for signing gems will need to be picked up by the line in the
|
72
|
+
`gemspec` defining the `spec.cert_chain` (check the relevant ENV variables there),
|
73
|
+
in order to sign the new release.
|
74
|
+
See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
75
|
+
|
76
|
+
### To release a new version:
|
77
|
+
|
78
|
+
1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check
|
79
|
+
2. Update the version number in `version.rb`
|
80
|
+
3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`
|
81
|
+
4. Run `git commit -am "🔖 Prepare release v<VERSION>"` to commit the changes
|
82
|
+
5. Run `git push` to trigger the final CI pipeline before release, & merge PRs
|
83
|
+
- NOTE: Remember to [check the build][🧪build]!
|
84
|
+
6. Run `export GIT_TRUNK_BRANCH_NAME="$(git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5)" && echo $GIT_TRUNK_BRANCH_NAME`
|
85
|
+
7. Run `git checkout $GIT_TRUNK_BRANCH_NAME`
|
86
|
+
8. Run `git pull origin $GIT_TRUNK_BRANCH_NAME` to ensure you will release the latest trunk code
|
87
|
+
9. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums
|
88
|
+
- Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH`
|
89
|
+
- If the echo above has no output, then it didn't work.
|
90
|
+
- Note that you'll need the `zsh/datetime` module, if running `zsh`.
|
91
|
+
- In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH`
|
92
|
+
10. Run `bundle exec rake build`
|
93
|
+
11. Run `bin/checksums` (more [context][🔒️rubygems-checksums-pr]) to create SHA-256 and SHA-512 checksums
|
94
|
+
- Checksums will be committed automatically by the script, but not pushed
|
95
|
+
12. Run `bundle exec rake release` which will create a git tag for the version,
|
96
|
+
push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems]
|
97
|
+
|
98
|
+
[🧪build]: https://github.com/pboling/activesupport-broadcast_logger/actions
|
99
|
+
[🤝conduct]: https://github.com/pboling/activesupport-broadcast_logger/blob/main/CODE_OF_CONDUCT.md
|
100
|
+
[🖐contrib-rocks]: https://contrib.rocks
|
101
|
+
[🖐contributors]: https://github.com/pboling/activesupport-broadcast_logger/graphs/contributors
|
102
|
+
[🖐contributors-img]: https://contrib.rocks/image?repo=pboling/activesupport-broadcast_logger
|
103
|
+
[💎rubygems]: https://rubygems.org
|
104
|
+
[🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
|
105
|
+
[🔒️rubygems-checksums-pr]: https://github.com/rubygems/guides/pull/325
|
106
|
+
[🚎src-main]: https://github.com/pboling/activesupport-broadcast_logger
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) David Heinemeier Hansson
|
4
|
+
Copyright (c) 2024 Peter Boling
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,274 @@
|
|
1
|
+
# Activesupport::BroadcastLogger
|
2
|
+
|
3
|
+
[![Version][👽versioni]][👽version]
|
4
|
+
[![License: MIT][📄license-img]][📄license-ref]
|
5
|
+
[![Downloads Rank][👽dl-ranki]][👽dl-rank]
|
6
|
+
[![Open Source Helpers][👽oss-helpi]][👽oss-help]
|
7
|
+
[![Depfu][🔑depfui♻️]][🔑depfu]
|
8
|
+
[![CodeCov][🔑codecovi♻️]][🔑codecov]
|
9
|
+
[![Test Coverage][🔑cc-covi♻️]][🔑cc-cov]
|
10
|
+
[![Maintainability][🔑cc-mnti♻️]][🔑cc-mnt]
|
11
|
+
[![CI Supported Build][🚎6-s-wfi]][🚎6-s-wf]
|
12
|
+
[![CI Legacy Build][🚎4-lg-wfi]][🚎4-lg-wf]
|
13
|
+
[![CI Unsupported Build][🚎7-us-wfi]][🚎7-us-wf]
|
14
|
+
[![CI Heads Build][🚎3-hd-wfi]][🚎3-hd-wf]
|
15
|
+
[![CI Coverage Build][🚎2-cov-wfi]][🚎2-cov-wf]
|
16
|
+
[![CI Style Build][🚎5-st-wfi]][🚎5-st-wf]
|
17
|
+
|
18
|
+
<!--- ( 👽️ INFO LINKS ) -->
|
19
|
+
|
20
|
+
[👽dl-rank]: https://rubygems.org/gems/activesupport-broadcast_logger
|
21
|
+
[👽dl-ranki]: https://img.shields.io/gem/rd/activesupport-broadcast_logger.svg
|
22
|
+
[👽oss-help]: https://www.codetriage.com/pboling/activesupport-broadcast_logger
|
23
|
+
[👽oss-helpi]: https://www.codetriage.com/pboling/activesupport-broadcast_logger/badges/users.svg
|
24
|
+
[👽version]: https://rubygems.org/gems/activesupport-broadcast_logger
|
25
|
+
[👽versioni]: https://img.shields.io/gem/v/activesupport-broadcast_logger.svg
|
26
|
+
|
27
|
+
<!--- ( 🔑 KEYED LINKS ) -->
|
28
|
+
|
29
|
+
[🔑cc-mnt]: https://codeclimate.com/github/pboling/activesupport-broadcast_logger/maintainability
|
30
|
+
[🔑cc-mnti♻️]: https://api.codeclimate.com/v1/badges/c19ba0b6a247c540ae50/maintainability
|
31
|
+
[🔑cc-cov]: https://codeclimate.com/github/pboling/activesupport-broadcast_logger/test_coverage
|
32
|
+
[🔑cc-covi♻️]: https://api.codeclimate.com/v1/badges/c19ba0b6a247c540ae50/test_coverage
|
33
|
+
[🔑codecov]: https://codecov.io/gh/pboling/activesupport-broadcast_logger
|
34
|
+
[🔑codecovi♻️]: https://codecov.io/gh/pboling/activesupport-broadcast_logger/branch/main/graph/badge.svg?token=1oWkmE3qSs
|
35
|
+
[🔑depfu]: https://depfu.com/github/pboling/activesupport-broadcast_logger
|
36
|
+
[🔑depfui♻️]: https://badges.depfu.com/badges/f6465157c6cc8971bff86ea59376bd8d/count.svg
|
37
|
+
|
38
|
+
<!--- ( 🚎 BUILD LINKS ) -->
|
39
|
+
|
40
|
+
[🚎2-cov-wf]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/coverage.yml
|
41
|
+
[🚎2-cov-wfi]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/coverage.yml/badge.svg
|
42
|
+
[🚎3-hd-wf]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/heads.yml
|
43
|
+
[🚎3-hd-wfi]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/heads.yml/badge.svg
|
44
|
+
[🚎4-lg-wf]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/legacy.yml
|
45
|
+
[🚎4-lg-wfi]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/legacy.yml/badge.svg
|
46
|
+
[🚎5-st-wf]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/style.yml
|
47
|
+
[🚎5-st-wfi]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/style.yml/badge.svg
|
48
|
+
[🚎6-s-wf]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/supported.yml
|
49
|
+
[🚎6-s-wfi]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/supported.yml/badge.svg
|
50
|
+
[🚎7-us-wf]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/unsupported.yml
|
51
|
+
[🚎7-us-wfi]: https://github.com/pboling/activesupport-broadcast_logger/actions/workflows/unsupported.yml/badge.svg
|
52
|
+
|
53
|
+
-----
|
54
|
+
|
55
|
+
[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
|
56
|
+
[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
|
57
|
+
[![Polar Shield][🖇polar-img]][🖇polar]
|
58
|
+
[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
|
59
|
+
[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
|
60
|
+
|
61
|
+
[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
|
62
|
+
[⛳liberapay]: https://liberapay.com/pboling/donate
|
63
|
+
[🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
|
64
|
+
[🖇sponsor]: https://github.com/sponsors/pboling
|
65
|
+
[🖇polar-img]: https://polar.sh/embed/seeks-funding-shield.svg?org=pboling
|
66
|
+
[🖇polar]: https://polar.sh/pboling
|
67
|
+
[🖇kofi-img]: https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg
|
68
|
+
[🖇kofi]: https://ko-fi.com/O5O86SNP4
|
69
|
+
[🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg
|
70
|
+
[🖇patreon]: https://patreon.com/galtzo
|
71
|
+
|
72
|
+
This is an **unofficial** extraction of Rails' v8 `ActiveSupport::BroadcastLogger` which has been:
|
73
|
+
* refactored ([here](https://github.com/rails/rails/pull/53093)) to only execute blocks once, and
|
74
|
+
* backported to work with Rails v5.2+ and Ruby 2.7+.
|
75
|
+
|
76
|
+
If the suite of gems this is part of is loaded in any version of Rails >= 5.2,
|
77
|
+
it will replace the logging tooling completely.
|
78
|
+
|
79
|
+
This gem is automatically depended on and configured by [activesupport-tagged_logging][activesupport-tagged_logging],
|
80
|
+
so you don't need to do anything beyond adding **that gem** to your app's Gemfile, and configuring it.
|
81
|
+
|
82
|
+
Simplified, the load order is basically:
|
83
|
+
|
84
|
+
- Enhanced [activesupport-logger][activesupport-logger] which was ripped from Rails v8.0
|
85
|
+
- Enhanced [activesupport-broadcast_logger][activesupport-broadcast_logger] (this gem) which was ripped from Rails v8.0, and [this PR][pr-53093]
|
86
|
+
- Enhanced [activesupport-tagged_logging][activesupport-tagged_logging] which was ripped from Rails v8.0, and [this PR][pr-53105]
|
87
|
+
|
88
|
+
Above load order is handled for you in [activesupport-tagged_logging][activesupport-tagged_logging] (not this gem),
|
89
|
+
so depend on that, not this. ;)
|
90
|
+
|
91
|
+
[activesupport-logger]: https://github.com/pboling/activesupport-logger
|
92
|
+
[activesupport-broadcast_logger]: https://github.com/pboling/activesupport-broadcast_logger
|
93
|
+
[activesupport-tagged_logging]: https://github.com/pboling/activesupport-tagged_logging
|
94
|
+
[pr-53105]: https://github.com/rails/rails/pull/53105
|
95
|
+
[pr-53093]: https://github.com/rails/rails/pull/53093
|
96
|
+
|
97
|
+
## Installation
|
98
|
+
|
99
|
+
NOTE: **Don't do this**. Instead, use [activesupport-tagged_logging][activesupport-tagged_logging]
|
100
|
+
(not this gem, but which uses this gem as a dependency).
|
101
|
+
|
102
|
+
Install the gem and add to the application's Gemfile by executing:
|
103
|
+
|
104
|
+
$ bundle add activesupport-broadcast_logger
|
105
|
+
|
106
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
107
|
+
|
108
|
+
$ gem install activesupport-broadcast_logger
|
109
|
+
|
110
|
+
## Usage
|
111
|
+
|
112
|
+
NOTE: **Don't do this**. Instead, use [activesupport-tagged_logging][activesupport-tagged_logging]
|
113
|
+
(not this gem, but which uses this gem as a dependency, and also configures this gem for you).
|
114
|
+
|
115
|
+
```ruby
|
116
|
+
require "activesupport-broadcast_logger"
|
117
|
+
```
|
118
|
+
|
119
|
+
### With `activesupport-logger` gem
|
120
|
+
|
121
|
+
[activesupport-logger][activesupport-logger]
|
122
|
+
is automatically depended on and configured by this gem,
|
123
|
+
so you don't need to do anything else.
|
124
|
+
|
125
|
+
IMPORTANT: When using this gem,
|
126
|
+
**do not `require "activesupport-logger"` in your code.**
|
127
|
+
Load order matters.
|
128
|
+
|
129
|
+
NOTE: The bits of logic that are unique to this gem are in the namespace `Activesupport` (sic).
|
130
|
+
|
131
|
+
## General Info
|
132
|
+
|
133
|
+
| Primary Namespaces | `Activesupport::BroadcastLogger` && `ActiveSupport::BroadcastLogger` && `Activesupport::FixPr53105` |
|
134
|
+
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
135
|
+
| documentation | [on Github.com][homepage], [Latest release on RubyDoc.info][documentation], [HEAD on RubyDoc.info][documentation-head] |
|
136
|
+
| expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
|
137
|
+
| `...` 💖 | [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] |
|
138
|
+
|
139
|
+
<!-- 7️⃣ spread 💖 -->
|
140
|
+
[🐦tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow%20%40galtzo
|
141
|
+
[🐦tweet]: http://twitter.com/galtzo
|
142
|
+
[🚎blog]: http://www.railsbling.com/tags/activesupport-broadcast_logger/
|
143
|
+
[🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
|
144
|
+
[🖇linkedin]: http://www.linkedin.com/in/peterboling
|
145
|
+
[🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-blue?style=plastic&logo=linkedin
|
146
|
+
[✌️wellfound]: https://angel.co/u/peter-boling
|
147
|
+
[✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=plastic&logo=wellfound
|
148
|
+
[💲crunchbase]: https://www.crunchbase.com/person/peter-boling
|
149
|
+
[💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=plastic&logo=crunchbase
|
150
|
+
[🐘ruby-mast]: https://ruby.social/@galtzo
|
151
|
+
[🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=plastic&logo=mastodon&label=Ruby%20%40galtzo
|
152
|
+
[🌳linktree]: https://linktr.ee/galtzo
|
153
|
+
[🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree
|
154
|
+
|
155
|
+
<!-- Maintainer Contact Links -->
|
156
|
+
[aboutme]: https://about.me/peter.boling
|
157
|
+
[coderme]: https://coderwall.com/Peter%20Boling
|
158
|
+
|
159
|
+
## 🤝 Contributing
|
160
|
+
|
161
|
+
If you need some ideas of where to help, you could work on adding more code coverage,
|
162
|
+
or if it is already 💯 then check [issues][🤝issues], or [PRs][🤝pulls],
|
163
|
+
or use the gem and think about how it could be better.
|
164
|
+
|
165
|
+
Also, see [CONTRIBUTING.md][🤝contributing].
|
166
|
+
|
167
|
+
[🤝issues]: https://github.com/pboling/activesupport-broadcast_logger/issues
|
168
|
+
[🤝pulls]: https://github.com/pboling/activesupport-broadcast_logger/pulls
|
169
|
+
[🤝contributing]: CONTRIBUTING.md
|
170
|
+
|
171
|
+
### Code Coverage
|
172
|
+
|
173
|
+
[![Coverage Graph][🔑codecov-g]][🔑codecov]
|
174
|
+
|
175
|
+
[🔑codecov-g]: https://codecov.io/gh/pboling/activesupport-broadcast_logger/graphs/tree.svg?token=cc6UdZCpAL
|
176
|
+
|
177
|
+
## 🌈 Contributors
|
178
|
+
|
179
|
+
[![Contributors][🖐contributors-img]][🖐contributors]
|
180
|
+
|
181
|
+
Made with [contributors-img][🖐contrib-rocks].
|
182
|
+
|
183
|
+
[🖐contrib-rocks]: https://contrib.rocks
|
184
|
+
[🖐contributors]: https://github.com/pboling/activesupport-broadcast_logger/graphs/contributors
|
185
|
+
[🖐contributors-img]: https://contrib.rocks/image?repo=pboling/activesupport-broadcast_logger
|
186
|
+
|
187
|
+
## Star History
|
188
|
+
|
189
|
+
<a href="https://star-history.com/#pboling/activesupport-broadcast_logger&Date">
|
190
|
+
<picture>
|
191
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=pboling/activesupport-broadcast_logger&type=Date&theme=dark" />
|
192
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=pboling/activesupport-broadcast_logger&type=Date" />
|
193
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=pboling/activesupport-broadcast_logger&type=Date" />
|
194
|
+
</picture>
|
195
|
+
</a>
|
196
|
+
|
197
|
+
## 🪇 Code of Conduct
|
198
|
+
|
199
|
+
Everyone interacting in this project's codebases, issue trackers,
|
200
|
+
chat rooms and mailing lists is expected to follow the [code of conduct][🪇conduct].
|
201
|
+
|
202
|
+
[🪇conduct]: CODE_OF_CONDUCT.md
|
203
|
+
|
204
|
+
## 📌 Versioning
|
205
|
+
|
206
|
+
This Library adheres to [Semantic Versioning 2.0.0][📌semver].
|
207
|
+
Violations of this scheme should be reported as bugs.
|
208
|
+
Specifically, if a minor or patch version is released that breaks backward compatibility,
|
209
|
+
a new version should be immediately released that restores compatibility.
|
210
|
+
Breaking changes to the public API will only be introduced with new major versions.
|
211
|
+
|
212
|
+
To get a better understanding of how SemVer is intended to work over a project's lifetime,
|
213
|
+
read this article from the creator of SemVer:
|
214
|
+
|
215
|
+
- ["Major Version Numbers are Not Sacred"][📌major-versions-not-sacred]
|
216
|
+
|
217
|
+
As a result of this policy, you can (and should) specify a dependency on these libraries using
|
218
|
+
the [Pessimistic Version Constraint][📌pvc] with two digits of precision.
|
219
|
+
|
220
|
+
For example:
|
221
|
+
|
222
|
+
```ruby
|
223
|
+
spec.add_dependency("activesupport-broadcast_logger", "~> 2.0")
|
224
|
+
```
|
225
|
+
|
226
|
+
See [CHANGELOG.md][📌changelog] for list of releases.
|
227
|
+
|
228
|
+
<!--- ( 📌 VERSIONING LINKS ) -->
|
229
|
+
|
230
|
+
[📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
231
|
+
[📌semver]: http://semver.org/
|
232
|
+
[📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html
|
233
|
+
[📌changelog]: CHANGELOG.md
|
234
|
+
|
235
|
+
## 📄 License
|
236
|
+
|
237
|
+
The gem is available as open source under the terms of
|
238
|
+
the [MIT License][📄license] [![License: MIT][📄license-img]][📄license-ref].
|
239
|
+
|
240
|
+
See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright-notice-explainer].
|
241
|
+
|
242
|
+
<!--- ( 📄 LEGAL LINKS ) -->
|
243
|
+
|
244
|
+
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
245
|
+
[📄license]: LICENSE.txt
|
246
|
+
[📄license-ref]: https://opensource.org/licenses/MIT
|
247
|
+
[📄license-img]: https://img.shields.io/badge/License-MIT-green.svg
|
248
|
+
|
249
|
+
### © Copyright
|
250
|
+
|
251
|
+
* Copyright (c) David Heinemeier Hansson
|
252
|
+
* Parts original to this extraction are:
|
253
|
+
* Copyright (c) 2024 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
254
|
+
|
255
|
+
[railsbling]: http://www.railsbling.com
|
256
|
+
[peterboling]: http://www.peterboling.com
|
257
|
+
[bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
258
|
+
[documentation]: http://rubydoc.info/gems/activesupport-broadcast_logger
|
259
|
+
[documentation-head]: https://rubydoc.info/github/pboling/activesupport-broadcast_logger/main
|
260
|
+
[homepage]: https://github.com/pboling/activesupport-broadcast_logger
|
261
|
+
|
262
|
+
## 🤑 One more thing
|
263
|
+
|
264
|
+
You made it to the bottom of the page,
|
265
|
+
so perhaps you'll indulge me for another 20 seconds.
|
266
|
+
I maintain many dozens of gems, including this one,
|
267
|
+
because I want Ruby to be a great place for people to solve problems, big and small.
|
268
|
+
Please consider supporting my efforts via the giant yellow link below,
|
269
|
+
or one of the others at the head of this README.
|
270
|
+
|
271
|
+
[![Buy me a latte][🖇buyme-img]][🖇buyme]
|
272
|
+
|
273
|
+
[🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
|
274
|
+
[🖇buyme]: https://www.buymeacoffee.com/pboling
|
data/SECURITY.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
| Version | Supported |
|
6
|
+
|---------|-----------|
|
7
|
+
| 2.x | ✅ |
|
8
|
+
|
9
|
+
## Reporting a Vulnerability
|
10
|
+
|
11
|
+
Peter Boling is the primary maintainer of this gem. Please find a way
|
12
|
+
to [contact him directly](https://railsbling.com/contact) to report the issue. Include as much relevant information as
|
13
|
+
possible.
|
@@ -0,0 +1,221 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ActiveSupport
|
4
|
+
# = Active Support Broadcast Logger
|
5
|
+
#
|
6
|
+
# The Broadcast logger is a logger used to write messages to multiple IO. It is commonly used
|
7
|
+
# in development to display messages on STDOUT and also write them to a file (development.log).
|
8
|
+
# With the Broadcast logger, you can broadcast your logs to a unlimited number of sinks.
|
9
|
+
#
|
10
|
+
# The BroadcastLogger acts as a standard logger and all methods you are used to are available.
|
11
|
+
# However, all the methods on this logger will propagate and be delegated to the other loggers
|
12
|
+
# that are part of the broadcast.
|
13
|
+
#
|
14
|
+
# Broadcasting your logs.
|
15
|
+
#
|
16
|
+
# stdout_logger = Logger.new(STDOUT)
|
17
|
+
# file_logger = Logger.new("development.log")
|
18
|
+
# broadcast = BroadcastLogger.new(stdout_logger, file_logger)
|
19
|
+
#
|
20
|
+
# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file.
|
21
|
+
#
|
22
|
+
# Add a logger to the broadcast.
|
23
|
+
#
|
24
|
+
# stdout_logger = Logger.new(STDOUT)
|
25
|
+
# broadcast = BroadcastLogger.new(stdout_logger)
|
26
|
+
# file_logger = Logger.new("development.log")
|
27
|
+
# broadcast.broadcast_to(file_logger)
|
28
|
+
#
|
29
|
+
# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file.
|
30
|
+
#
|
31
|
+
# Modifying the log level for all broadcasted loggers.
|
32
|
+
#
|
33
|
+
# stdout_logger = Logger.new(STDOUT)
|
34
|
+
# file_logger = Logger.new("development.log")
|
35
|
+
# broadcast = BroadcastLogger.new(stdout_logger, file_logger)
|
36
|
+
#
|
37
|
+
# broadcast.level = Logger::FATAL # Modify the log level for the whole broadcast.
|
38
|
+
#
|
39
|
+
# Stop broadcasting log to a sink.
|
40
|
+
#
|
41
|
+
# stdout_logger = Logger.new(STDOUT)
|
42
|
+
# file_logger = Logger.new("development.log")
|
43
|
+
# broadcast = BroadcastLogger.new(stdout_logger, file_logger)
|
44
|
+
# broadcast.info("Hello world!") # Writes the log to STDOUT and the development.log file.
|
45
|
+
#
|
46
|
+
# broadcast.stop_broadcasting_to(file_logger)
|
47
|
+
# broadcast.info("Hello world!") # Writes the log *only* to STDOUT.
|
48
|
+
#
|
49
|
+
# At least one sink has to be part of the broadcast. Otherwise, your logs will not
|
50
|
+
# be written anywhere. For instance:
|
51
|
+
#
|
52
|
+
# broadcast = BroadcastLogger.new
|
53
|
+
# broadcast.info("Hello world") # The log message will appear nowhere.
|
54
|
+
#
|
55
|
+
# If you are adding a custom logger with custom methods to the broadcast,
|
56
|
+
# the `BroadcastLogger` will proxy them and return the raw value, or an array
|
57
|
+
# of raw values, depending on how many loggers in the broadcasts responded to
|
58
|
+
# the method:
|
59
|
+
#
|
60
|
+
# class MyLogger < ::Logger
|
61
|
+
# def loggable?
|
62
|
+
# true
|
63
|
+
# end
|
64
|
+
# end
|
65
|
+
#
|
66
|
+
# logger = BroadcastLogger.new
|
67
|
+
# logger.loggable? # => A NoMethodError exception is raised because no loggers in the broadcasts could respond.
|
68
|
+
#
|
69
|
+
# logger.broadcast_to(MyLogger.new(STDOUT))
|
70
|
+
# logger.loggable? # => true
|
71
|
+
# logger.broadcast_to(MyLogger.new(STDOUT))
|
72
|
+
# puts logger.broadcasts # => [MyLogger, MyLogger]
|
73
|
+
# logger.loggable? # [true, true]
|
74
|
+
class BroadcastLogger
|
75
|
+
include ActiveSupport::LoggerSilence
|
76
|
+
|
77
|
+
# Returns all the logger that are part of this broadcast.
|
78
|
+
attr_reader :broadcasts
|
79
|
+
attr_accessor :progname
|
80
|
+
|
81
|
+
def initialize(*loggers)
|
82
|
+
@broadcasts = []
|
83
|
+
@progname = "Broadcast"
|
84
|
+
|
85
|
+
broadcast_to(*loggers)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Add logger(s) to the broadcast.
|
89
|
+
#
|
90
|
+
# broadcast_logger = ActiveSupport::BroadcastLogger.new
|
91
|
+
# broadcast_logger.broadcast_to(Logger.new(STDOUT), Logger.new(STDERR))
|
92
|
+
def broadcast_to(*loggers)
|
93
|
+
@broadcasts.concat(loggers)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Remove a logger from the broadcast. When a logger is removed, messages sent to
|
97
|
+
# the broadcast will no longer be written to its sink.
|
98
|
+
#
|
99
|
+
# sink = Logger.new(STDOUT)
|
100
|
+
# broadcast_logger = ActiveSupport::BroadcastLogger.new
|
101
|
+
#
|
102
|
+
# broadcast_logger.stop_broadcasting_to(sink)
|
103
|
+
def stop_broadcasting_to(logger)
|
104
|
+
@broadcasts.delete(logger)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Forward all standard Logger methods to each logger in the broadcast.
|
108
|
+
LOGGER_METHODS = %w[
|
109
|
+
<<
|
110
|
+
log
|
111
|
+
add
|
112
|
+
debug
|
113
|
+
info
|
114
|
+
warn
|
115
|
+
error
|
116
|
+
fatal
|
117
|
+
unknown
|
118
|
+
debug!
|
119
|
+
info!
|
120
|
+
warn!
|
121
|
+
error!
|
122
|
+
fatal!
|
123
|
+
level=
|
124
|
+
sev_threshold=
|
125
|
+
local_level
|
126
|
+
local_level=
|
127
|
+
close
|
128
|
+
formatter
|
129
|
+
formatter=
|
130
|
+
]
|
131
|
+
LOGGER_METHODS.each do |method|
|
132
|
+
class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
133
|
+
def #{method}(*args, **kwargs, &block)
|
134
|
+
dispatch(:#{method}, *args, **kwargs, &block)
|
135
|
+
end
|
136
|
+
RUBY
|
137
|
+
end
|
138
|
+
|
139
|
+
# Returns the lowest level of all the loggers in the broadcast.
|
140
|
+
def level
|
141
|
+
@broadcasts.map(&:level).min
|
142
|
+
end
|
143
|
+
|
144
|
+
# +True+ if the log level allows entries with severity Logger::DEBUG to be written
|
145
|
+
# to at least one broadcast. +False+ otherwise.
|
146
|
+
def debug?
|
147
|
+
@broadcasts.any? { |logger| logger.debug? }
|
148
|
+
end
|
149
|
+
|
150
|
+
# +True+ if the log level allows entries with severity Logger::INFO to be written
|
151
|
+
# to at least one broadcast. +False+ otherwise.
|
152
|
+
def info?
|
153
|
+
@broadcasts.any? { |logger| logger.info? }
|
154
|
+
end
|
155
|
+
|
156
|
+
# +True+ if the log level allows entries with severity Logger::WARN to be written
|
157
|
+
# to at least one broadcast. +False+ otherwise.
|
158
|
+
def warn?
|
159
|
+
@broadcasts.any? { |logger| logger.warn? }
|
160
|
+
end
|
161
|
+
|
162
|
+
# +True+ if the log level allows entries with severity Logger::ERROR to be written
|
163
|
+
# to at least one broadcast. +False+ otherwise.
|
164
|
+
def error?
|
165
|
+
@broadcasts.any? { |logger| logger.error? }
|
166
|
+
end
|
167
|
+
|
168
|
+
# +True+ if the log level allows entries with severity Logger::FATAL to be written
|
169
|
+
# to at least one broadcast. +False+ otherwise.
|
170
|
+
def fatal?
|
171
|
+
@broadcasts.any? { |logger| logger.fatal? }
|
172
|
+
end
|
173
|
+
|
174
|
+
def initialize_copy(other)
|
175
|
+
@broadcasts = []
|
176
|
+
@progname = other.progname.dup
|
177
|
+
|
178
|
+
broadcast_to(*other.broadcasts.map(&:dup))
|
179
|
+
end
|
180
|
+
|
181
|
+
private
|
182
|
+
|
183
|
+
def dispatch(method, *args, **kwargs, &block)
|
184
|
+
if block_given?
|
185
|
+
# Maintain semantics that the first logger yields the block
|
186
|
+
# as normal, but subsequent loggers won't re-execute the block.
|
187
|
+
# Instead, the initial result is immediately returned.
|
188
|
+
called, result = false, nil
|
189
|
+
block = proc { |*args, **kwargs|
|
190
|
+
if called then result
|
191
|
+
else
|
192
|
+
called = true
|
193
|
+
result = yield(*args, **kwargs)
|
194
|
+
end
|
195
|
+
}
|
196
|
+
end
|
197
|
+
|
198
|
+
@broadcasts.map { |logger|
|
199
|
+
if logger.respond_to?(method)
|
200
|
+
logger.send(method, *args, **kwargs, &block)
|
201
|
+
end
|
202
|
+
}.first
|
203
|
+
end
|
204
|
+
|
205
|
+
def method_missing(name, *args, **kwargs, &block)
|
206
|
+
loggers = @broadcasts.select { |logger| logger.respond_to?(name) }
|
207
|
+
|
208
|
+
if loggers.none?
|
209
|
+
super
|
210
|
+
elsif loggers.one?
|
211
|
+
loggers.first.send(name, *args, **kwargs, &block)
|
212
|
+
else
|
213
|
+
loggers.map { |logger| logger.send(name, *args, **kwargs, &block) }
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
def respond_to_missing?(method, include_all)
|
218
|
+
@broadcasts.any? { |logger| logger.respond_to?(method, include_all) }
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# External libraries
|
2
|
+
require "active_support/version"
|
3
|
+
require "version_gem"
|
4
|
+
|
5
|
+
# This library
|
6
|
+
require_relative "activesupport/broadcast_logger/version"
|
7
|
+
|
8
|
+
# Loads supporting features from Rails v5, 6, or 7
|
9
|
+
require "active_support/core_ext/module/delegation"
|
10
|
+
require "active_support/core_ext/object/blank"
|
11
|
+
|
12
|
+
# Require the extracted-from-Rails-8 ActiveSupport::Logger
|
13
|
+
require "activesupport-logger"
|
14
|
+
|
15
|
+
# Require original broadcast logging from whatever version of Rails is loaded,
|
16
|
+
# so that it will be properly monkey patched.
|
17
|
+
# Versions of Rails < 7.1 do not have it, which is fine,
|
18
|
+
# as the purpose of this gem is to make it available, while also fixing it.
|
19
|
+
begin
|
20
|
+
require "active_support/broadcast_logger"
|
21
|
+
rescue LoadError
|
22
|
+
warn("[Activesupport::BroadcastLogger] ActiveSupport::BroadcastLogger is not available. Your Rails will be enhanced to have it!")
|
23
|
+
end
|
24
|
+
|
25
|
+
# !!ORDER MATTERS!!
|
26
|
+
|
27
|
+
# Extracted from:
|
28
|
+
# https://github.com/rails/rails/blame/6041bd04e8be0ec3b5e850f66fe932a8f5941237/activesupport/lib/active_support/broadcast_logger.rb
|
29
|
+
# which at the time was the latest version of the file from Rails PR 53093:
|
30
|
+
# Compare SHA with latest commit to the same file on `main` to check for changes:
|
31
|
+
# https://github.com/rails/rails/pull/53093/files
|
32
|
+
#
|
33
|
+
# All this reloading might print warnings about redefined methods, and this is expected.
|
34
|
+
# Technically it might even break things, but we don't expect it to, and YMMV.
|
35
|
+
require_relative "activesupport/broadcast_logger"
|
36
|
+
|
37
|
+
# Namespace for the Version of this gem (and nothing else)
|
38
|
+
module Activesupport
|
39
|
+
end
|
40
|
+
|
41
|
+
Activesupport::BroadcastLogger::Version.class_eval do
|
42
|
+
extend VersionGem::Basic
|
43
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,422 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activesupport-broadcast_logger
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Boling
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
|
14
|
+
ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
|
15
|
+
A2NvbTAeFw0yNDA5MjAwODU4NDJaFw0yNTA5MjAwODU4NDJaMEMxFTATBgNVBAMM
|
16
|
+
DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
|
17
|
+
LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAjrxsKObI
|
18
|
+
rFQjBpzvVfqnT6JlF8/pkpgEEjFh7ex3zIerfuHzZvSrx+sRDGxQ8koWWG0Wjx8s
|
19
|
+
wkBZ5dIqvl0g3sWP5asa28u/09opxkQTC1Ao77iYxcBcwoCe/Dpf1m4Q/m6oH0kL
|
20
|
+
2AZVNJQL3UkqAcLS0tsj/s/jAKnVlsaZZE5gQiIIi8HtkvSsajtx+Cq2AxDvcWvV
|
21
|
+
/CliD+pmzYkTjvjwGm8yeyFGGGgrisJMryiZdZlkTwrQSjCzudIKbLeuG8Se4JTD
|
22
|
+
TAcT+rPubr27v1jwmtIjtiot3rf4nof7LHLb122a/0VR7cC7xPLnXw0Cq1BShvoq
|
23
|
+
/GKRdSwMNinTOGkFTK1gKnjN+3iD4zyXU3XO3CXoTr+Ju8fXPN1x4tpOMgbv8dme
|
24
|
+
WbcQMOH9ZjmA5w0bSVRL1c3NhRRpUzrKTNXBEvqOyWjUnintxWKj+cRXx+z+dUgI
|
25
|
+
dL3kj68fcsiTgl75In3C485pnCMmq1eLuVoiy3jkLNOn2lHeLt9ZK63LAgMBAAGj
|
26
|
+
fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRhfc+2UaVYd74p
|
27
|
+
yJ1JclGiUYN8+jAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
|
28
|
+
A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
|
29
|
+
ggGBAA4fLU2+mQ++jBhVM2IeyvQdw1nm+0thkH4Ldv8ZOBm5ZxCPGIMoYliDDzg4
|
30
|
+
4JDFxZR1wR4sdrz/K5tWtEkN23SKzopwbNb1NIQRSLQ7nOoc+4bkuz9xwKinmIvF
|
31
|
+
D+5qsl2S27WLKFreMDtGoh0CREIMBUxU4rGTh0gtzmweGR+fnOShg4Jo0kxrjU5h
|
32
|
+
uYk/uVE+bn/jOEGs43GvKXZLyshpBrZjQ+ArbvxDht5t35zbSxerbUxUPZUbXUCW
|
33
|
+
tTyh38a9UYjAAHvnh6Y4Fi9wd4/pGNsektrzB3z/zlVj4YF2TMLX9XfNJWEGRGpO
|
34
|
+
sSkLYdtEX1WQAmuZtActVW2cL3HdQaRbiv7VbfpA0eSk0ZdZHvBCl516ZZu10uX6
|
35
|
+
82W1mg6fuezdpeBOiXwrEbZSt/oGiF4V511F6nd55p0okwHc/6nS10F/3aKJ4gwC
|
36
|
+
I5o+DRfXQHqKucx1ldFHvI2rE/kSCWqGTHN2eyu1sqCPeOoIMxrltJhaejKPkxqj
|
37
|
+
zaF9Og==
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: logger
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 1.6.1
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.6'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.6.1
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: mutex_m
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0.1'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0.1'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rdoc
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '6.8'
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 6.8.1
|
85
|
+
type: :runtime
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '6.8'
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 6.8.1
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: stringio
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.0.2
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 0.0.2
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: activesupport
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '5.2'
|
116
|
+
type: :runtime
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '5.2'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: activesupport-logger
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '2.0'
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 2.0.0
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '2.0'
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 2.0.0
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: version_gem
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '1.1'
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 1.1.4
|
153
|
+
type: :runtime
|
154
|
+
prerelease: false
|
155
|
+
version_requirements: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.1'
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 1.1.4
|
163
|
+
- !ruby/object:Gem::Dependency
|
164
|
+
name: yard
|
165
|
+
requirement: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - "~>"
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0.9'
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 0.9.37
|
173
|
+
type: :development
|
174
|
+
prerelease: false
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0.9'
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: 0.9.37
|
183
|
+
- !ruby/object:Gem::Dependency
|
184
|
+
name: yard-junk
|
185
|
+
requirement: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - "~>"
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: 0.0.10
|
190
|
+
type: :development
|
191
|
+
prerelease: false
|
192
|
+
version_requirements: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - "~>"
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: 0.0.10
|
197
|
+
- !ruby/object:Gem::Dependency
|
198
|
+
name: kettle-soup-cover
|
199
|
+
requirement: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - "~>"
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '1.0'
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: 1.0.4
|
207
|
+
type: :development
|
208
|
+
prerelease: false
|
209
|
+
version_requirements: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - "~>"
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '1.0'
|
214
|
+
- - ">="
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
version: 1.0.4
|
217
|
+
- !ruby/object:Gem::Dependency
|
218
|
+
name: appraisal
|
219
|
+
requirement: !ruby/object:Gem::Requirement
|
220
|
+
requirements:
|
221
|
+
- - "~>"
|
222
|
+
- !ruby/object:Gem::Version
|
223
|
+
version: '2.5'
|
224
|
+
type: :development
|
225
|
+
prerelease: false
|
226
|
+
version_requirements: !ruby/object:Gem::Requirement
|
227
|
+
requirements:
|
228
|
+
- - "~>"
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '2.5'
|
231
|
+
- !ruby/object:Gem::Dependency
|
232
|
+
name: minitest
|
233
|
+
requirement: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - "~>"
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '5.25'
|
238
|
+
- - ">="
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: 5.25.1
|
241
|
+
type: :development
|
242
|
+
prerelease: false
|
243
|
+
version_requirements: !ruby/object:Gem::Requirement
|
244
|
+
requirements:
|
245
|
+
- - "~>"
|
246
|
+
- !ruby/object:Gem::Version
|
247
|
+
version: '5.25'
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: 5.25.1
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: rake
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '13'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '13'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: rspec
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '3.13'
|
272
|
+
type: :development
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - "~>"
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '3.13'
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: rspec-block_is_expected
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - "~>"
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '1.0'
|
286
|
+
- - ">="
|
287
|
+
- !ruby/object:Gem::Version
|
288
|
+
version: 1.0.6
|
289
|
+
type: :development
|
290
|
+
prerelease: false
|
291
|
+
version_requirements: !ruby/object:Gem::Requirement
|
292
|
+
requirements:
|
293
|
+
- - "~>"
|
294
|
+
- !ruby/object:Gem::Version
|
295
|
+
version: '1.0'
|
296
|
+
- - ">="
|
297
|
+
- !ruby/object:Gem::Version
|
298
|
+
version: 1.0.6
|
299
|
+
- !ruby/object:Gem::Dependency
|
300
|
+
name: test-unit
|
301
|
+
requirement: !ruby/object:Gem::Requirement
|
302
|
+
requirements:
|
303
|
+
- - "~>"
|
304
|
+
- !ruby/object:Gem::Version
|
305
|
+
version: '3.6'
|
306
|
+
- - ">="
|
307
|
+
- !ruby/object:Gem::Version
|
308
|
+
version: 3.6.2
|
309
|
+
type: :development
|
310
|
+
prerelease: false
|
311
|
+
version_requirements: !ruby/object:Gem::Requirement
|
312
|
+
requirements:
|
313
|
+
- - "~>"
|
314
|
+
- !ruby/object:Gem::Version
|
315
|
+
version: '3.6'
|
316
|
+
- - ">="
|
317
|
+
- !ruby/object:Gem::Version
|
318
|
+
version: 3.6.2
|
319
|
+
- !ruby/object:Gem::Dependency
|
320
|
+
name: rubocop-lts
|
321
|
+
requirement: !ruby/object:Gem::Requirement
|
322
|
+
requirements:
|
323
|
+
- - "~>"
|
324
|
+
- !ruby/object:Gem::Version
|
325
|
+
version: '18.2'
|
326
|
+
- - ">="
|
327
|
+
- !ruby/object:Gem::Version
|
328
|
+
version: 18.2.1
|
329
|
+
type: :development
|
330
|
+
prerelease: false
|
331
|
+
version_requirements: !ruby/object:Gem::Requirement
|
332
|
+
requirements:
|
333
|
+
- - "~>"
|
334
|
+
- !ruby/object:Gem::Version
|
335
|
+
version: '18.2'
|
336
|
+
- - ">="
|
337
|
+
- !ruby/object:Gem::Version
|
338
|
+
version: 18.2.1
|
339
|
+
- !ruby/object:Gem::Dependency
|
340
|
+
name: rubocop-packaging
|
341
|
+
requirement: !ruby/object:Gem::Requirement
|
342
|
+
requirements:
|
343
|
+
- - "~>"
|
344
|
+
- !ruby/object:Gem::Version
|
345
|
+
version: '0.5'
|
346
|
+
- - ">="
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: 0.5.2
|
349
|
+
type: :development
|
350
|
+
prerelease: false
|
351
|
+
version_requirements: !ruby/object:Gem::Requirement
|
352
|
+
requirements:
|
353
|
+
- - "~>"
|
354
|
+
- !ruby/object:Gem::Version
|
355
|
+
version: '0.5'
|
356
|
+
- - ">="
|
357
|
+
- !ruby/object:Gem::Version
|
358
|
+
version: 0.5.2
|
359
|
+
- !ruby/object:Gem::Dependency
|
360
|
+
name: rubocop-rspec
|
361
|
+
requirement: !ruby/object:Gem::Requirement
|
362
|
+
requirements:
|
363
|
+
- - "~>"
|
364
|
+
- !ruby/object:Gem::Version
|
365
|
+
version: '3.0'
|
366
|
+
type: :development
|
367
|
+
prerelease: false
|
368
|
+
version_requirements: !ruby/object:Gem::Requirement
|
369
|
+
requirements:
|
370
|
+
- - "~>"
|
371
|
+
- !ruby/object:Gem::Version
|
372
|
+
version: '3.0'
|
373
|
+
description: Rails v8 ActiveSupport::BroadcastLogger, fixed & backported to Rails
|
374
|
+
v5.2+ & Ruby 2.7+
|
375
|
+
email:
|
376
|
+
- peter.boling@gmail.com
|
377
|
+
executables: []
|
378
|
+
extensions: []
|
379
|
+
extra_rdoc_files: []
|
380
|
+
files:
|
381
|
+
- CHANGELOG.md
|
382
|
+
- CODE_OF_CONDUCT.md
|
383
|
+
- CONTRIBUTING.md
|
384
|
+
- LICENSE.txt
|
385
|
+
- README.md
|
386
|
+
- SECURITY.md
|
387
|
+
- lib/activesupport-broadcast_logger.rb
|
388
|
+
- lib/activesupport/broadcast_logger.rb
|
389
|
+
- lib/activesupport/broadcast_logger/version.rb
|
390
|
+
homepage: https://github.com/pboling/activesupport-broadcast_logger
|
391
|
+
licenses:
|
392
|
+
- MIT
|
393
|
+
metadata:
|
394
|
+
homepage_uri: https://github.com/pboling/activesupport-broadcast_logger
|
395
|
+
source_code_uri: https://github.com/pboling/activesupport-broadcast_logger/tree/v2.0.0
|
396
|
+
changelog_uri: https://github.com/pboling/activesupport-broadcast_logger/blob/v2.0.0/CHANGELOG.md
|
397
|
+
bug_tracker_uri: https://github.com/pboling/activesupport-broadcast_logger/issues
|
398
|
+
documentation_uri: https://www.rubydoc.info/gems/activesupport-broadcast_logger/2.0.0
|
399
|
+
wiki_uri: https://github.com/pboling/activesupport-broadcast_logger/wiki
|
400
|
+
funding_uri: https://liberapay.com/pboling
|
401
|
+
rubygems_mfa_required: 'true'
|
402
|
+
post_install_message:
|
403
|
+
rdoc_options: []
|
404
|
+
require_paths:
|
405
|
+
- lib
|
406
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
407
|
+
requirements:
|
408
|
+
- - ">="
|
409
|
+
- !ruby/object:Gem::Version
|
410
|
+
version: 2.7.0
|
411
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
412
|
+
requirements:
|
413
|
+
- - ">="
|
414
|
+
- !ruby/object:Gem::Version
|
415
|
+
version: '0'
|
416
|
+
requirements: []
|
417
|
+
rubygems_version: 3.5.23
|
418
|
+
signing_key:
|
419
|
+
specification_version: 4
|
420
|
+
summary: Rails v8 ActiveSupport::BroadcastLogger, fixed & backported to Rails v5.2+
|
421
|
+
& Ruby 2.7+
|
422
|
+
test_files: []
|
metadata.gz.sig
ADDED