logspot 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -0
- data/lib/logspot.rb +3 -4
- data/logspot.gemspec +1 -1
- data/spec/logspot_spec.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25c21c7f245b06c8ae83b61a341fb4f68d8891d4
|
4
|
+
data.tar.gz: 6fa944d1c7a88e99fdd1eaf9d0f4e3b146f34406
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d3cc1ed9775c242bb6b0fab3f0a542e874e072f5df6adc2461543c468c39a2a8b881974566910dce9896c525e5dc440538dc1a922840818da933ad28be1351
|
7
|
+
data.tar.gz: 67b6a35ac38fcb819cba4a11e43cb1310b31a4382d18c679a6be09827ffeca7112fd16e6ab9e58d6ebc52fcf7889bf0499547f853abe781f377533c5c592b709
|
data/Gemfile.lock
CHANGED
data/lib/logspot.rb
CHANGED
@@ -4,8 +4,8 @@ class LoGspot
|
|
4
4
|
LOG_LEVELS = %w(DEBUG INFO WARN ERROR FATAL)
|
5
5
|
|
6
6
|
def initialize(file_or_file_name = STDOUT, wrapper: nil, tag_format: '[%{time} %{level}] ', time_format: '%Y/%m/%d %H:%M:%S', tag_block: nil)
|
7
|
-
wrapper
|
8
|
-
base = tag_block ? tag_block.(Time.current, level) : tag_format % { time: Time.current.strftime(time_format), level: level }
|
7
|
+
wrapper ||= ->(output, data) {
|
8
|
+
base = tag_block ? tag_block.(Time.current, data[:level]) : tag_format % { time: Time.current.strftime(time_format), level: data[:level] }
|
9
9
|
if data[:space]
|
10
10
|
base = ' ' * uncolorize_str(base).length
|
11
11
|
end
|
@@ -106,8 +106,7 @@ class LoGspot
|
|
106
106
|
attr_reader :raw_output, :top_output, :output, :level
|
107
107
|
|
108
108
|
def write(l, *args, &block)
|
109
|
-
|
110
|
-
output.puts(message: args[0], args: args, arg_block: block)
|
109
|
+
output.puts(level: l, message: args[0], args: args, arg_block: block)
|
111
110
|
end
|
112
111
|
|
113
112
|
def wrap_output(block, *args, &wrapper)
|
data/logspot.gemspec
CHANGED
data/spec/logspot_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logspot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsuri Moriya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -83,4 +83,3 @@ signing_key:
|
|
83
83
|
specification_version: 4
|
84
84
|
summary: Logger
|
85
85
|
test_files: []
|
86
|
-
has_rdoc:
|