Sha256: 1625a5a79af9109279993fef9cf2ed6176aae8f2f1366ae5cc3a5ab2d47fb2b1
Contents?: true
Size: 641 Bytes
Versions: 3
Compression:
Stored size: 641 Bytes
Contents
module GitlabAwesomeRelease module GitlabLoggingExt [:get, :post, :put, :delete].each do |method| define_method method do |path, options = {}| begin start_time = Time.now super(path, options) ensure end_time = Time.now # NOTE: options[:headers] contains PRIVATE-TOKEN _options = options.reject{ |k, _v| k == :headers } logger.debug "(#{end_time - start_time} sec) #{method.upcase} #{path} #{_options}" end end end end end Gitlab::Request.class_eval do prepend GitlabAwesomeRelease::GitlabLoggingExt cattr_accessor :logger end
Version data entries
3 entries across 3 versions & 1 rubygems