ougai 1.8.1 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdfdff5fa693d4f9cc99ebcf23f98d469efd554bc305ef235808a08d614492f5
4
- data.tar.gz: a62f7b67bb08ce159c18ce11055556d9363ab828d6d4c18c033c9a77e3275158
3
+ metadata.gz: 1b45eb1e81ef91fcc455dca9d94ad63c236d87c17ffaf5ef9e1571a9cfd4fda0
4
+ data.tar.gz: 6961172d50ada3b26fa5ddb13bcf031fc90a9a99bd8d44ad7039e6238c7dce87
5
5
  SHA512:
6
- metadata.gz: 82e5cb16d19270f57b2b398419a5f75c0feb459fa93925870662e7763722d718f0b2c8528f42c8b7ce97570310b55185235fa62e3a04a373c410484f76e5fd60
7
- data.tar.gz: 00ba0a0e24b2dda62a19e31774c24bd6178f89f5edb1856528ed5411b2f07a03a8e0eca888eadb3c4e5ac32dbdfcf0fc5afdb03961311534f1721de9b7a538f2
6
+ metadata.gz: 3af65c720a8c8de54cb7fb18fa7708463f290bc4b5d1f9a932c1b66d062f7d00cbe988c7242d26221f17a417fd2c24d75a900dfe3b8f43bbe36abc89ffab928c
7
+ data.tar.gz: 5ea383b9efe95c5e3160090430063b1023e80e9103a135a7fa99f3c11805b48c1fca89f558c2b3e5b8ac120b8e6c184c92adb5d88f1406e3787b4c35382d198c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ougai (1.8.1)
4
+ ougai (1.8.2)
5
5
  oj (~> 3.4)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -2,7 +2,7 @@ Ougai
2
2
  =====
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/ougai.svg)](https://badge.fury.io/rb/ougai)
5
- [![document](https://img.shields.io/badge/document-1.8.1-green.svg)](http://www.rubydoc.info/gems/ougai/)
5
+ [![document](https://img.shields.io/badge/document-1.8.2-green.svg)](http://www.rubydoc.info/gems/ougai/)
6
6
  [![Build Status](https://travis-ci.org/tilfin/ougai.svg?branch=master)](https://travis-ci.org/tilfin/ougai)
7
7
  [![Code Climate](https://codeclimate.com/github/tilfin/ougai/badges/gpa.svg)](https://codeclimate.com/github/tilfin/ougai)
8
8
  [![Test Coverage](https://codeclimate.com/github/tilfin/ougai/badges/coverage.svg)](https://codeclimate.com/github/tilfin/ougai/coverage)
@@ -28,7 +28,8 @@ module Ougai
28
28
  load_dependent
29
29
  end
30
30
 
31
- def _call(severity, time, progname, data)
31
+ def _call(severity, time, progname, _data)
32
+ data = _data.dup
32
33
  msg = data.delete(:msg)
33
34
  level = @plain ? severity : colored_level(severity)
34
35
  dt = format_datetime(time)
data/lib/ougai/logger.rb CHANGED
@@ -38,13 +38,9 @@ module Ougai
38
38
  # @param logger [Logger] The logger receiving broadcast logs.
39
39
  def self.broadcast(logger)
40
40
  Module.new do |mdl|
41
- Logger::Severity.constants.each do |severity|
42
- method_name = severity.downcase.to_sym
43
-
44
- mdl.send(:define_method, method_name) do |*args|
45
- logger.send(method_name, *args)
46
- super(*args)
47
- end
41
+ define_method(:log) do |*args|
42
+ logger.log(*args)
43
+ super(*args)
48
44
  end
49
45
 
50
46
  define_method(:level=) do |level|
data/lib/ougai/logging.rb CHANGED
@@ -107,8 +107,7 @@ module Ougai
107
107
  end
108
108
  end
109
109
 
110
- private
111
-
110
+ # @private
112
111
  def log(severity, message, ex, data, block)
113
112
  return true if level > severity
114
113
  args = block ? block.call : [message, ex, data]
data/lib/ougai/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ougai
4
- VERSION = '1.8.1'
4
+ VERSION = '1.8.2'
5
5
  end
data/spec/logger_spec.rb CHANGED
@@ -645,7 +645,7 @@ describe Ougai::Logger do
645
645
  end
646
646
 
647
647
  it 'outputs info log with block on both loggers' do
648
- logger.info(log_msg, foo: 2)
648
+ logger.info { [log_msg, { foo: 2 }] }
649
649
  expect(item).to be_log_message(log_msg, 30)
650
650
  expect(item).to include_data(foo: 2)
651
651
  expect(another_item).to be_log_message(log_msg, 30)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ougai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshimitsu Takahashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-28 00:00:00.000000000 Z
11
+ date: 2019-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj