123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- /**
- * @file
- * Log Entry class.
- */
- namespace Redis\Logger;
- /**
- * Class Entry
- *
- * @package Redis\Logger
- *
- * @see hook_watchdog()
- */
- class Entry {
- /**
- * @var string
- */
- public $type;
- /**
- * @var stdClass
- * A possibly incomplete Drupal user object.
- */
- public $user;
- /**
- * @var int
- */
- public $uid;
- /**
- * @var string
- */
- public $request_uri;
- /**
- * @var string
- */
- public $referer;
- /**
- * @var string
- */
- public $ip;
- /**
- * @var int
- */
- public $timestamp;
- /**
- * @var int
- * Use WATCHDOG_* constants.
- */
- public $severity;
- /**
- * @var string
- */
- public $link;
- /**
- * @var string
- */
- public $message;
- /**
- * @var string[]
- */
- public $variables;
- public function __construct(array $entry) {
- foreach ($entry as $k => $v) {
- if (property_exists($this, $k)) {
- $this->$k = $v;
- }
- }
- }
- /**
- * @param Settings $settings
- *
- * @return string
- */
- public function getTemplateKey(Settings $settings) {
- return $settings->getPrefix() . "{$this->type}:{$this->severity}:{$this->message}";
- }
- }
|