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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ece65b475f10961a1676f2ee93267fb74cb95cf1
4
- data.tar.gz: 844f73b09c506445694540aa28d0d53fad80e97f
3
+ metadata.gz: a34ce239ffea3824d8b75f4b20ada1efeab5dabb
4
+ data.tar.gz: 068d3c4b9a3bbe98f27602ef33d99f95bc99e807
5
5
  SHA512:
6
- metadata.gz: 96c9dfac4de0c32c19b26bf6154bb3b410d8b76dd326e99f29ea1b4f0de571cecba193f85da6eb09598398320adbc5ea21f05de669baf9833a3ef5084b791879
7
- data.tar.gz: 8efa1dd12b595043c7b2e8351ed5f136086cbbdfc57da12ef5f98c004059bd6b23d41703974a59ac266f3e187cfaff007601229c6b7c7711d32bafce8f7657c7
6
+ metadata.gz: 5e5d1aee4394305ccd5b1c49ea8db8762676cb645687afafd4e3805d61fa66ed7a6964833479a4104f8619f298b5e3e0fefb0f3fea5b5dec4b11d9d03ae29136
7
+ data.tar.gz: 5592ae110c3e514de3ce06deb204977b58a50dd68ef05fc4999a740bd9dbc3c3762c575d41750482db0ff203103241f5f88df8f237c383d67fc98dc490f7cf63
@@ -1,3 +1,9 @@
1
+ # 0.0.4 (2015/03/21)
2
+
3
+ Fixes:
4
+
5
+ * logger method should accept nil for lazy loading as `log.debug { "lazy" }`
6
+
1
7
  # 0.0.3 (2014/07/25)
2
8
 
3
9
  Changes:
@@ -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"
@@ -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.3"
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.3
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: 2014-07-24 00:00:00.000000000 Z
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.0
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.