Permalink
Browse files

added a log-silencer

  • Loading branch information...
mugwump committed Mar 7, 2013
1 parent 75889d3 commit 489baf625a22cc25a9953c74e77c6d20b96b8f59
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/freebase_rb/api.rb
  2. +5 −0 lib/freebase_rb/config.rb
View
@@ -89,7 +89,7 @@ def self.cache_key_for_url(url)
end
def self.log(message)
- @logger.debug("FreebaseRb: #{message}")
+ @logger.debug("FreebaseRb: #{message}") if Config.settings[:logging]
end
end
end
@@ -6,6 +6,7 @@ class << self
@settings = {
:api_key => nil,
+ :logging => false,
:cache => {
:is_active => false,
:expires_in => 1.day
@@ -19,5 +20,9 @@ def self.api_key(api_key)
def self.cache(options)
@settings[:cache].merge!(options)
end
+
+ def logging(is_enabled)
+ @settings[:api_key] = is_enabled
+ end
end
end

0 comments on commit 489baf6

Please sign in to comment.