Skip to content

Commit

Permalink
set default logger level to Logger::WARN
Browse files Browse the repository at this point in the history
  • Loading branch information
youpy committed Jan 19, 2012
1 parent a1e540d commit e607cbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/scissor.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def Scissor(filename_or_url = nil)


module Scissor module Scissor
@logger = Logger.new(STDOUT) @logger = Logger.new(STDOUT)
@logger.level = Logger::INFO @logger.level = Logger::WARN

FFMPEG.logger = @logger


class << self class << self
attr_accessor :logger attr_accessor :logger
Expand Down
8 changes: 6 additions & 2 deletions spec/scissor_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@


describe Scissor do describe Scissor do
before do before do
FFMPEG.logger.level = Logger::WARN

@mp3 = Scissor(fixture('sample.mp3')) @mp3 = Scissor(fixture('sample.mp3'))
mkdir '/tmp/scissor-test' mkdir '/tmp/scissor-test'


Expand All @@ -20,6 +18,12 @@
rm_rf '/tmp/scissor-test' rm_rf '/tmp/scissor-test'
end end


it "should set default logger level to Logger::WARN" do
[Scissor, FFMPEG].each do |mod|
mod.logger.level.should eql(Logger::WARN)
end
end

it "should create from url" do it "should create from url" do
url = 'http://example.com/sample_mp3' url = 'http://example.com/sample_mp3'
FakeWeb.register_uri(:get, url, :body => fixture('sample.mp3'), :content_type => 'audio/mpeg') FakeWeb.register_uri(:get, url, :body => fixture('sample.mp3'), :content_type => 'audio/mpeg')
Expand Down

0 comments on commit e607cbf

Please sign in to comment.