You are here

public function CasHelper::log in CAS 8

Same name and namespace in other branches
  1. 2.x src/Service/CasHelper.php \Drupal\cas\Service\CasHelper::log()

Wrap Drupal's normal logger.

This allows us to only log debug messages if configured to do so.

Parameters

mixed $level: The message to log.

string $message: The error message.

array $context: The context.

1 call to CasHelper::log()
CasHelper::handleReturnToParameter in src/Service/CasHelper.php
Converts a "returnto" query param to a "destination" query param.

File

src/Service/CasHelper.php, line 168

Class

CasHelper
Class CasHelper.

Namespace

Drupal\cas\Service

Code

public function log($level, $message, array $context = []) {

  // Back out of logging if it's a debug message and we're not configured
  // to log those types of messages. This helps keep the drupal log clean
  // on busy sites.
  if ($level == LogLevel::DEBUG && !$this->settings
    ->get('advanced.debug_log')) {
    return;
  }
  $this->loggerChannel
    ->log($level, $message, $context);
}