strftime_logger 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/strftime_logger.rb +6 -6
- data/spec/strftime_logger_spec.rb +7 -0
- data/strftime_logger.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a34ce239ffea3824d8b75f4b20ada1efeab5dabb
|
4
|
+
data.tar.gz: 068d3c4b9a3bbe98f27602ef33d99f95bc99e807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e5d1aee4394305ccd5b1c49ea8db8762676cb645687afafd4e3805d61fa66ed7a6964833479a4104f8619f298b5e3e0fefb0f3fea5b5dec4b11d9d03ae29136
|
7
|
+
data.tar.gz: 5592ae110c3e514de3ce06deb204977b58a50dd68ef05fc4999a740bd9dbc3c3762c575d41750482db0ff203103241f5f88df8f237c383d67fc98dc490f7cf63
|
data/CHANGELOG.md
CHANGED
data/lib/strftime_logger.rb
CHANGED
@@ -115,27 +115,27 @@ class StrftimeLogger
|
|
115
115
|
end
|
116
116
|
alias log add
|
117
117
|
|
118
|
-
def debug(msg, &block)
|
118
|
+
def debug(msg = nil, &block)
|
119
119
|
add(DEBUG, msg, &block)
|
120
120
|
end
|
121
121
|
|
122
|
-
def info(msg, &block)
|
122
|
+
def info(msg = nil, &block)
|
123
123
|
add(INFO, msg, &block)
|
124
124
|
end
|
125
125
|
|
126
|
-
def warn(msg, &block)
|
126
|
+
def warn(msg = nil, &block)
|
127
127
|
add(WARN, msg, &block)
|
128
128
|
end
|
129
129
|
|
130
|
-
def error(msg, &block)
|
130
|
+
def error(msg = nil, &block)
|
131
131
|
add(ERROR, msg, &block)
|
132
132
|
end
|
133
133
|
|
134
|
-
def fatal(msg, &block)
|
134
|
+
def fatal(msg = nil, &block)
|
135
135
|
add(FATAL, msg, &block)
|
136
136
|
end
|
137
137
|
|
138
|
-
def unknown(msg, &block)
|
138
|
+
def unknown(msg = nil, &block)
|
139
139
|
add(UNKNOWN, msg, &block)
|
140
140
|
end
|
141
141
|
|
@@ -34,6 +34,13 @@ describe StrftimeLogger do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
%w[debug info warn error fatal unknown].each_with_index do |level, severity|
|
38
|
+
it "#{level} with block" do
|
39
|
+
subject.__send__(level) { "test" }
|
40
|
+
expect(File.read("#{log_dir}/application.log.#{today}")).to eq "#{now} [#{LEVEL_TEXT[severity]}] test\n"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
37
44
|
it 'multiline' do
|
38
45
|
subject.info("foo\nbar")
|
39
46
|
expect(File.read("#{log_dir}/application.log.#{today}")).to eq "#{now} [INFO] foo\\nbar\n"
|
data/strftime_logger.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "strftime_logger"
|
7
|
-
gem.version = "0.0.
|
7
|
+
gem.version = "0.0.4"
|
8
8
|
gem.authors = ["Naotoshi Seo"]
|
9
9
|
gem.email = ["sonots@gmail.com"]
|
10
10
|
gem.description = %q{A logger treats log rotation in strftime fashion}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strftime_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A logger treats log rotation in strftime fashion
|
14
14
|
email:
|
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
59
|
rubyforge_project:
|
60
|
-
rubygems_version: 2.2.
|
60
|
+
rubygems_version: 2.2.2
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: A logger treats log rotation in strftime fashion.
|