<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,9 +1,9 @@
 development:
-  enabled: false
+  logging_enabled: true
   logger_class: &lt;%= class_name %&gt; 
 test:
-  enabled: false
+  logging_enabled: false
   logger_class: &lt;%= class_name %&gt; 
 production:
-  enabled: true
+  logging_enabled: true
   logger_class: &lt;%= class_name %&gt; </diff>
      <filename>generators/tartarus/templates/config/exceptions.yml</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,5 @@
 #tartarus #exception { clear: both; }
 #tartarus #exception_actions { float: right; }
 
-.toggle_data { display: none }
-#backtrace_information .toggle_data { display: block; }
+#tartarus .toggle_data { display: none }
+#tartarus #backtrace_information .toggle_data { display: block; }</diff>
      <filename>generators/tartarus/templates/public/stylesheets/tartarus.css</filename>
    </modified>
    <modified>
      <diff>@@ -10,12 +10,15 @@ class Tartarus
     def logger_class
       configuration['logger_class'].constantize
     end
+    
+    def logging_enabled?
+      configuration['logging_enabled'] == true
+    end
 
     def log(controller, exception)
       logger_class.log(controller, exception)
     end
   end
-
 end
 
 require 'tartarus/logger'</diff>
      <filename>lib/tartarus.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,9 @@ module Tartarus::Rescue
   end
   
   def rescue_action_with_tartarus(exception)
-    if response_code_for_rescue(exception) == :internal_server_error
+    is_exception = response_code_for_rescue(exception) == :internal_server_error
+
+    if is_exception and Tartarus.logging_enabled?
       Tartarus.log(self, exception)
     end
 </diff>
      <filename>lib/tartarus/rescue.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ describe Tartarus::Rescue do
       @exception = StandardError.new
       @controller.stub!(:rescue_action_without_tartarus)
       @controller.stub!(:response_code_for_rescue).and_return(:internal_server_error)
+      Tartarus.stub!(:logging_enabled?).and_return(true)
       Tartarus.stub!(:log)
     end
 
@@ -34,6 +35,18 @@ describe Tartarus::Rescue do
       @controller.rescue_action_with_tartarus(@exception)
     end
 
+    it 'should log the exception with tartarus if exception logging is enabled' do
+      Tartarus.should_receive(:logging_enabled?).and_return(true)
+      @controller.rescue_action_with_tartarus(@exception)
+    end
+
+    it 'should not log the exception with tartarus if exception logging is disabled' do
+      Tartarus.should_receive(:logging_enabled?).and_return(false)
+      Tartarus.should_receive(:log).never
+
+      @controller.rescue_action_with_tartarus(@exception)
+    end
+
     it 'should invoke rescue_action_without_tartarus' do
       @controller.should_receive(:rescue_action_without_tartarus)
       @controller.rescue_action_with_tartarus(@exception)</diff>
      <filename>spec/tartarus/rescue_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,19 @@ describe Tartarus do
       Tartarus.logger_class.should == LoggedException
     end
   end
+  
+  describe &quot;#logging_enabled?&quot; do
+    it 'should return false if logging is not enabled in the configuration' do
+      Tartarus.should_receive(:configuration).and_return({ 'logging_enabled' =&gt; false })
+      Tartarus.logging_enabled?.should be_false
+    end
+
+    it 'should return true if logging is enabled in the configuration' do
+      Tartarus.should_receive(:configuration).and_return({ 'logging_enabled' =&gt; true })
+      Tartarus.logging_enabled?.should be_true
+    end
+  end
+  
 
   describe &quot;#log&quot; do
     before(:each) do
@@ -32,7 +45,7 @@ describe Tartarus do
 
   describe &quot;#configuration&quot; do
     before(:each) do
-      YAML.stub!(:load_file).and_return({'development' =&gt; { 'enabled' =&gt; true }, 'test' =&gt; { 'enabled' =&gt; false } })
+      YAML.stub!(:load_file).and_return({ 'development' =&gt; { 'enabled' =&gt; true }, 'test' =&gt; { 'enabled' =&gt; false } })
     end
 
     it 'should parse the YAML configuration file for exceptional' do</diff>
      <filename>spec/tartarus_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>370e7f068ead1f4d1d9d28fcaa82c5b52ede9600</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Insley</name>
    <email>dan@viviti.com</email>
  </author>
  <url>http://github.com/dinsley/tartarus/commit/b5dfc9c012ea03e176421b0f2bbda6dd801966b6</url>
  <id>b5dfc9c012ea03e176421b0f2bbda6dd801966b6</id>
  <committed-date>2009-10-22T13:01:05-07:00</committed-date>
  <authored-date>2009-10-22T13:01:05-07:00</authored-date>
  <message>logging_enabled is configuration is now loaded to see if logging should occur or not</message>
  <tree>dcaa39d3e774c26a49fb7d01b821eeccae2297cf</tree>
  <committer>
    <name>Daniel Insley</name>
    <email>dan@viviti.com</email>
  </committer>
</commit>
