You are here

public function HudtException::logMessage in Hook Update Deploy Tools 8

Same name and namespace in other branches
  1. 7 src/HudtException.php \HookUpdateDeployTools\HudtException::logMessage()

Logs the message to Watchdog.

Parameters

string $pre: A string to prepend to the message.

string $post: A string to append to the message.

Return value

string The return from Message::make() or getMessage() if logging was skipped.

File

src/HudtException.php, line 49

Class

HudtException
Public method for importing Rules.

Namespace

HookUpdateDeployTools

Code

public function logMessage($pre = '', $post = '') {
  if ($this->logIt) {

    // Log it to watchdog.
    $full_message = "{$pre}{$this->watchdogMessage}{$post}";
    return Message::make($full_message, $this->vars, $this->watchdogCode, 1);
  }
  return $this
    ->getMessage();
}