Преглед на файлове

Fixed logging to file to include the URL of the website logging the error. This makes it easier to read the log file when there is more than one Drupal site on the same machine.

Lacey Sanderson преди 9 години
родител
ревизия
e8d61cc118
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      tripal_core/api/tripal_core.tripal.api.inc

+ 3 - 3
tripal_core/api/tripal_core.tripal.api.inc

@@ -126,7 +126,7 @@ function tripal_report_error($type, $severity, $message, $variables = array(), $
   }
 
   // Print to the Tripal error log
-  tripal_log( $severity_string . ' (' . strtoupper($type) . '): ' . $print_message . "\n", 'error');
+  tripal_log('[' . strtoupper($type) . '] ' . $print_message . "\n", $severity_string);
 
 }
 
@@ -221,14 +221,14 @@ function tripal_set_message($message, $importance = TRIPAL_INFO, $options = arra
  */
 function tripal_log($message, $type = 'error', $options = array()) {
   global $base_url;
-  $prefix = '[TRIPAL ' . strtoupper(check_plain($type)) . '] ';
+  $prefix = '[site ' . $base_url . '] [TRIPAL ' . strtoupper(check_plain($type)) . '] ';
 
   if (!isset($options['is_progress_bar'])) {
     $message = $prefix . str_replace("\n", "", trim($message));
   }
 
   if (isset($options['first_progress_bar'])) {
-    $message = trim($message);
+    $message = $prefix . trim($message);
   }
 
   return error_log($message);