diff --git a/rules.module b/rules.module
index 038288e..77b4fa1 100644
--- a/rules.module
+++ b/rules.module
@@ -1383,11 +1383,14 @@ function rules_drupal_goto_alter(&$path, &$options, &$http_response_code) {
  * Returns whether the debug log should be shown.
  */
 function rules_show_debug_output() {
-  if (variable_get('rules_debug', FALSE) == RulesLog::INFO && user_access('access rules debug')) {
-    return TRUE;
-  }
-  // For performance avoid unnecessary auto-loading of the RulesLog class.
-  return variable_get('rules_debug', FALSE) == RulesLog::WARN && user_access('access rules debug') && class_exists('RulesLog', FALSE) && RulesLog::logger()->hasErrors();
+    // For performance avoid unnecessary auto-loading of the RulesLog class.
+    if (!class_exists('RulesLog', FALSE)) {
+        return FALSE;
+    }
+    if (variable_get('rules_debug', FALSE) == RulesLog::INFO && user_access('access rules debug')) {
+        return TRUE;
+    }
+    return variable_get('rules_debug', FALSE) == RulesLog::WARN && user_access('access rules debug') && RulesLog::logger()->hasErrors();
 }
 
 /**
