|
| __construct () |
|
| setModule ($module) |
|
| setJob (\Drupal\tripal\Services\TripalJob $job) |
|
| notice ($message, $context=[], $options=[]) |
|
| info ($message, $context=[], $options=[]) |
|
| error ($message, $context=[], $options=[]) |
|
| warning ($message, $context=[], $options=[]) |
|
| emergency ($message, $context=[], $options=[]) |
|
| alert ($message, $context=[], $options=[]) |
|
| critical ($message, $context=[], $options=[]) |
|
| debug ($message, $context=[], $options=[]) |
|
| log ($level, $message, $context=[], $options=[]) |
|
◆ __construct()
Drupal\tripal\Services\TripalLogger::__construct |
( |
| ) |
|
Constructor: initialize connections.
◆ alert()
Drupal\tripal\Services\TripalLogger::alert |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs an alert message.
A prefix of "ALERT: " is added to the message to Tripal jobs.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ critical()
Drupal\tripal\Services\TripalLogger::critical |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs a crtical message.
A prefix of "CRITICAL: " is added to the message to Tripal jobs.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ debug()
Drupal\tripal\Services\TripalLogger::debug |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs a debug message.
A prefix of "DEBUG: " is added to the message to Tripal jobs.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log
- Drupal Message (if specified in options)
For Tripal 3, no debug messages were logged unless the TRIPAL_DEBUG environment variable is set. Under Tripal 4, debug messages are always printed.
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ emergency()
Drupal\tripal\Services\TripalLogger::emergency |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs an emergency message.
A prefix of "EMERGENCY: " is added to the message to Tripal jobs.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ error()
Drupal\tripal\Services\TripalLogger::error |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs an error message.
A prefix of "ERROR: " is added to the message to Tripal jobs.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ info()
Drupal\tripal\Services\TripalLogger::info |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs an info message.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
|
◆ initLogger()
Drupal\tripal\Services\TripalLogger::initLogger |
( |
| ) |
|
|
protected |
Intiailizes the Drupal logger.
◆ isSuppressed()
Drupal\tripal\Services\TripalLogger::isSuppressed |
( |
| ) |
|
|
protected |
Checks if error suppression is enabled.
For backwards compatibility with Tripal v3 this function checks the TRIPAL_SUPPRESS_ERRORS environment variable. If it is set then all logging is suppressed even if it is not an "error" message.
◆ log()
Drupal\tripal\Services\TripalLogger::log |
( |
|
$level, |
|
|
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
A wrapper for the Drupal::Logger log function
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log if not 'info' or 'notice'
- Drupal Message (if specified in options)
A prefix indicating the level (other than info and notice messages) is added to the message to Tripal jobs.
- Parameters
-
$level | The level to log: emergency, critical, alert, error, warning, notice, info, debug. |
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ log2Job()
Drupal\tripal\Services\TripalLogger::log2Job |
( |
|
$message, |
|
|
|
$context = [] |
|
) |
| |
|
protected |
Logs a message directly to the job.
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
◆ log2Message()
Drupal\tripal\Services\TripalLogger::log2Message |
( |
|
$level, |
|
|
|
$message, |
|
|
|
$context = [] |
|
) |
| |
|
protected |
Prints the message as a Drupal status message to the page.
- Parameters
-
$level | The level of the message: critical, error, emergency, alert, warning, info or notice. |
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
◆ log2Server()
Drupal\tripal\Services\TripalLogger::log2Server |
( |
|
$message, |
|
|
|
$context, |
|
|
|
$options |
|
) |
| |
|
protected |
Sends the log message to the webserver server logs.
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
◆ messageString()
Drupal\tripal\Services\TripalLogger::messageString |
( |
|
$message, |
|
|
|
$context |
|
) |
| |
|
protected |
Converts the logged message into a full string
Performs replacmeent of the tokens in the message with the values in the context array.
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
◆ notice()
Drupal\tripal\Services\TripalLogger::notice |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs a notice message.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
|
◆ setJob()
A setter for the job object if this class is being run using a Tripal job.
◆ setModule()
Drupal\tripal\Services\TripalLogger::setModule |
( |
|
$module | ) |
|
Set the name of the module that should be used for logging.
- Parameters
-
◆ warning()
Drupal\tripal\Services\TripalLogger::warning |
( |
|
$message, |
|
|
|
$context = [] , |
|
|
|
$options = [] |
|
) |
| |
Logs a warning message.
A prefix of "WARNING: " is added to the message to Tripal jobs.
Logs to:
- Drupal Logger (unless specified in options)
- Tripal Job log
- Server log
- Drupal Message (if specified in options)
- Parameters
-
$message | The message MUST be a string or object implementing __toString(). |
$context | The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo". The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception". |
$options | An array of options where the following keys are supported:
- drupal_set_message: set to TRUE if this message should also be shown as a message for the user to see on the page.
- logger: set to FALSE if this message should not be sent to the Drupal logger.
- first_progress_bar: this should be used for the first log call for a progress bar.
- is_progress_bar: this option should be used for all but the first print of a progress bar to allow it all to be printed on the same line without intervening date prefixes.
|
◆ $job
Drupal\tripal\Services\TripalLogger::$job = NULL |
|
protected |
◆ $logger
Drupal\tripal\Services\TripalLogger::$logger |
|
protected |
The drupal logger object.
◆ $module
Drupal\tripal\Services\TripalLogger::$module = 'tripal' |
|
protected |
The module for which messages should be logged
The documentation for this class was generated from the following file:
- tripal/src/Services/TripalLogger.php