-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ability to specify custom logger * Add test * Use regex match * Add custom logging in the log writer * Write to custom logger instead of stdout if custom logger is present * Check that the custom logger responds to write * Use safe navigation * Initialize to prevent warning * Move test to not run parallel * Update lib/puma/dsl.rb Co-authored-by: Jack <5182053+phyzical@users.noreply.github.com> * Update lib/puma/launcher.rb Co-authored-by: Jack <5182053+phyzical@users.noreply.github.com> * Update test/test_config.rb Co-authored-by: Jack <5182053+phyzical@users.noreply.github.com> * Update test/test_config.rb Co-authored-by: Jack <5182053+phyzical@users.noreply.github.com> * Update test/config/custom_logger.rb Co-authored-by: Jack <5182053+phyzical@users.noreply.github.com> --------- Co-authored-by: Jack <5182053+phyzical@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class CustomLogger | ||
def initialize(output=STDOUT) | ||
@output = output | ||
end | ||
|
||
def write(msg) | ||
@output.puts 'Custom logging: ' + msg | ||
@output.flush | ||
end | ||
end | ||
|
||
log_requests | ||
custom_logger CustomLogger.new(STDOUT) |
This file contains 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