-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I think logger is only used to figure out which methods need to be made noops in order to silence webrick during tests. However, it seems possible to do the same using webrick's builtin logger and the current method does not seem even correct since it's not guaranteed that the logger gem and webrick's logger will use the same methods.
- Loading branch information
1 parent
78cec33
commit a3882dc
Showing
5 changed files
with
7 additions
and
11 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require "logger" | ||
require "webrick" | ||
module Spec | ||
class SilentLogger | ||
(::Logger.instance_methods - Object.instance_methods).each do |logger_instance_method| | ||
define_method(logger_instance_method) {|*args, &blk| } | ||
class SilentLogger < WEBrick::BasicLog | ||
def initialize(log_file = nil, level = nil) | ||
super(log_file, level || FATAL) | ||
end | ||
end | ||
end |
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