Class: Pact::MockService::Logger
- Inherits:
-
Logger
- Object
- Logger
- Pact::MockService::Logger
- Defined in:
- lib/pact/mock_service/logger.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stream) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize(stream) ⇒ Logger
Returns a new instance of Logger.
9 10 11 12 13 14 15 16 |
# File 'lib/pact/mock_service/logger.rb', line 9 def initialize stream super stream @description = if stream.is_a? File File.absolute_path(stream).gsub(Dir.pwd + "/", '') else "standard out/err" end end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/pact/mock_service/logger.rb', line 7 def description @description end |
Class Method Details
.from_options(options) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/pact/mock_service/logger.rb', line 18 def self. log_stream = [:log_file] || $stdout logger = new log_stream logger.formatter = [:log_formatter] if [:log_formatter] logger.level = ::Logger::DEBUG logger end |