lib/protobuf/logger.rb in protobuffy-3.2.0 vs lib/protobuf/logger.rb in protobuffy-3.3.0
- old
+ new
@@ -12,11 +12,18 @@
instance && instance.__send__(m, *params, &block)
end
end
end
- # One-line file/level configuration
+ # One-line file/level/logger configuration. If logger is
+ # specified, file and level are ignored.
+ #
+ # @param options [Hash] Hash of options for the logger
+ # @option :logger [::Logger] Logger instance to use underneath.
+ # @option :file [String] File name to log to. Ignored if :logger is specified
+ # @option :level [Logger::Severity] Level to log at. Ignored if :logger is specified
def self.configure(options)
+ @__instance = options.fetch(:logger, nil)
self.file = options.fetch(:file, false)
self.level = options.fetch(:level, false)
end
# Use to reset the instance