smart_logger_wrapper 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/README.md +2 -0
- data/bin/console +4 -4
- data/lib/smart_logger_wrapper.rb +2 -2
- data/lib/smart_logger_wrapper/utils/backtrace.rb +1 -1
- data/lib/smart_logger_wrapper/version.rb +1 -1
- data/smart_logger_wrapper.gemspec +3 -0
- metadata +45 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d85fb54a1c93b6fa1438590e23c21259349451a0856adfd5ce775656ada1d4a
|
4
|
+
data.tar.gz: 78a9c0297f38cc6d326aa6bf36bc270feab954e6cc19b8aeb3d6b39d19371f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 220771b11522adaee420b9cd9b78d0fd08be250986e896922215afd56ad0a63fe4cc3246d73eae598ebc5dcefa0b4453e91a0448fb8a304c06f9124644cb651f
|
7
|
+
data.tar.gz: 9705bdd7ab9f8f119c5d598f82d15990826b635e9312c2b0706088fec31306963c6e95e68a283bdd10681c303e5d77004bfeacfac5727154a32c26fc811527ef
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
SmartLoggerWrapper adds some useful features to the Ruby Logger or its subclasses. See Usage below to find out how it benefits your development.
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/smart_logger_wrapper.svg)](https://badge.fury.io/rb/smart_logger_wrapper)
|
5
6
|
[![Build Status](https://travis-ci.org/akeyhero/smart_logger_wrapper.svg?branch=master)](https://travis-ci.org/akeyhero/smart_logger_wrapper)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/github/akeyhero/smart_logger_wrapper/badge.svg?branch=master)](https://coveralls.io/github/akeyhero/smart_logger_wrapper?branch=master)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
data/bin/console
CHANGED
@@ -7,8 +7,8 @@ require "smart_logger_wrapper"
|
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
|
11
|
-
|
10
|
+
require "pry"
|
11
|
+
Pry.start
|
12
12
|
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
13
|
+
# require "irb"
|
14
|
+
# IRB.start(__FILE__)
|
data/lib/smart_logger_wrapper.rb
CHANGED
@@ -69,7 +69,7 @@ class SmartLoggerWrapper < Logger
|
|
69
69
|
|
70
70
|
def with_option(option_name, *args)
|
71
71
|
new_options = options.merge(option_name => args)
|
72
|
-
self.class.new(*loggers, base_offset: base_offset, **new_options)
|
72
|
+
self.class.new(*loggers, base_offset: base_offset, parent: parent, **new_options)
|
73
73
|
end
|
74
74
|
|
75
75
|
private
|
@@ -121,7 +121,7 @@ class SmartLoggerWrapper < Logger
|
|
121
121
|
|
122
122
|
def method_missing(method_name, *args, &block)
|
123
123
|
if root? && Options.defined_option?(method_name)
|
124
|
-
# When
|
124
|
+
# When a root wrapper receives an defined option with the same name as the method name,
|
125
125
|
# return a new logger wrapper with the option.
|
126
126
|
@_loggers_cache[method_name] = {} unless @_loggers_cache.include?(method_name)
|
127
127
|
logger_with_option = @_loggers_cache[method_name][args] ||= with_option(method_name, *args)
|
@@ -8,7 +8,7 @@ class SmartLoggerWrapper < Logger
|
|
8
8
|
|
9
9
|
def get_backtrace(start, length = nil)
|
10
10
|
# add 1 to `start` because this method dug the backtrace by 1
|
11
|
-
backtrace = clean_backtrace(
|
11
|
+
backtrace = clean_backtrace(caller(start + 1))
|
12
12
|
length == nil ? backtrace.to_a : backtrace.first(length)
|
13
13
|
end
|
14
14
|
|
@@ -24,4 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.14"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "pry-byebug", "~> 3.0"
|
28
|
+
spec.add_development_dependency "simplecov", "~> 0.14"
|
29
|
+
spec.add_development_dependency "coveralls", "~> 0.8"
|
27
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_logger_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akihiro Katsura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,48 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.14'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.14'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.8'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.8'
|
55
97
|
description:
|
56
98
|
email:
|
57
99
|
- info@kats.la
|
@@ -59,6 +101,7 @@ executables: []
|
|
59
101
|
extensions: []
|
60
102
|
extra_rdoc_files: []
|
61
103
|
files:
|
104
|
+
- ".coveralls.yml"
|
62
105
|
- ".gitignore"
|
63
106
|
- ".rspec"
|
64
107
|
- ".ruby-version"
|