Tripal
|
Functions | |
tripal_report_error ($type, $severity, $message, $variables=[], $options=[]) | |
tripal_log ($message, $type='error', $options=[]) | |
tripal_set_message ($message, $importance=TRIPAL_INFO, $options=[]) | |
Provides an application programming interface (API) for improved user notifications. These API functions can be used to set messages for end-users, administrators, or simple logging.
tripal_log | ( | $message, | |
$type = 'error' , |
|||
$options = [] |
|||
) |
DEPRECATED
File-based error logging for Tripal.
This function is deprecated in Tripal v4. It will be removed in a future release of Tripal. Please use the \Drupal\tripal\Services\TripalLogger class instead.
Consider using the tripal_report_error function rather than calling this function directly, as that function calls this one for non INFO messages and has greater functionality.
$message | The message to be logged. Need not contain date/time information. |
$log_type | The type of log. Should be one of 'error' or 'job' although other types are supported. |
$options | An array of options where the following keys are supported:
|
tripal_report_error | ( | $type, | |
$severity, | |||
$message, | |||
$variables = [] , |
|||
$options = [] |
|||
) |
DEPRECATED
Provide better error notice for Tripal.
This function is deprecated in Tripal v4. It will be removed in a future release of Tripal. Please use the \Drupal\tripal\Services\TripalLogger class instead.
Please be sure to set the $options array as desired. For example, by default this function sends all messages to the Drupal logger. If a long running job uses this function and prints status messages you may not want to have those go to the logger as it can dramatically affect performance.
If the environment variable 'TRIPAL_DEBUG' is set to 1 then this function will add backtrace information to the message.
$type | The catagory to which this message belongs. Can be any string, but the general practice is to use the name of the module. |
$severity | The severity of the message; one of the following values:
|
$message | The message to store in the log. Keep $message translatable by not concatenating dynamic values into it! Variables in the message should be added by using placeholder strings alongside the variables argument to declare the value of the placeholders. See t() for documentation on how $message and $variables interact. |
$variables | Array of variables to replace in the message on display or NULL if message is already translated or not possible to translate. |
$options | An array of options. Some available options include:
|
tripal_set_message | ( | $message, | |
$importance = TRIPAL_INFO , |
|||
$options = [] |
|||
) |
Display messages to tripal administrators.
This can be used instead of drupal_set_message when you want to target tripal administrators.
$message | The message to be displayed to the tripal administrators. |
$importance | The level of importance for this message. In the future this will be used to allow administrators to filter some of these messages. It can be one of the following:
|
$options | Any options to apply to the current message. Supported options include:
|