fume 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/fume.gemspec +2 -2
- data/lib/fume/smart_logger.rb +4 -2
- data/spec/fume/smart_logger_spec.rb +6 -2
- metadata +2 -2
data/VERSION.yml
CHANGED
data/fume.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fume}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sunteya"]
|
12
|
-
s.date = %q{2010-01
|
12
|
+
s.date = %q{2010-02-01}
|
13
13
|
s.email = %q{Sunteya@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README"
|
data/lib/fume/smart_logger.rb
CHANGED
@@ -2,8 +2,8 @@ require "logger"
|
|
2
2
|
|
3
3
|
module Fume
|
4
4
|
class SmartLogger
|
5
|
-
def self.create(name)
|
6
|
-
case name
|
5
|
+
def self.create(name, log_level = Logger::DEBUG)
|
6
|
+
logger = case name
|
7
7
|
when "STDOUT"
|
8
8
|
Logger.new(STDOUT)
|
9
9
|
when /(\w+)/
|
@@ -13,6 +13,8 @@ module Fume
|
|
13
13
|
else
|
14
14
|
Logger.new(Rails.root.join("log", "#{Rails.env}.log"))
|
15
15
|
end
|
16
|
+
logger.level = log_level
|
17
|
+
logger
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -7,12 +7,16 @@ describe Fume::SmartLogger do
|
|
7
7
|
|
8
8
|
it "should be create STDOUT logger" do
|
9
9
|
Logger.should_receive(:new).with(STDOUT).and_return(@logger)
|
10
|
-
SmartLogger.create("STDOUT")
|
10
|
+
result = SmartLogger.create("STDOUT")
|
11
|
+
result.should be_eql @logger
|
12
|
+
result.level.should be_eql Logger::DEBUG
|
11
13
|
end
|
12
14
|
|
13
15
|
it "should be create log file logger" do
|
14
16
|
Logger.should_receive(:new).with(Rails.root.join("log", "file.log")).and_return(@logger)
|
15
|
-
SmartLogger.create("file")
|
17
|
+
result = SmartLogger.create("file", Logger::INFO)
|
18
|
+
result.should be_eql @logger
|
19
|
+
result.level.should be_eql Logger::INFO
|
16
20
|
end
|
17
21
|
|
18
22
|
it "should be create log file logger with ext" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fume
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunteya
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01
|
12
|
+
date: 2010-02-01 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|