Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.
   1  <?php
   2  /**
   3   * Copyright 2008-2017 Horde LLC (http://www.horde.org/)
   4   *
   5   * See the enclosed file LICENSE for license information (LGPL). If you
   6   * did not receive this file, see http://www.horde.org/licenses/lgpl21.
   7   *
   8   * @author   
   9   * @category Horde
  10   * @license  http://www.horde.org/licenses/lgpl21 LGPL-2.1
  11   * @package  Exception
  12   */
  13  
  14  /**
  15   * Horde base exception class.
  16   *
  17   * @author    
  18   * @category  Horde
  19   * @copyright 2008-2017 Horde LLC
  20   * @license   http://www.horde.org/licenses/lgpl21 LGPL-2.1
  21   * @package   Exception
  22   */
  23  class Horde_Exception extends Exception
  24  {
  25      /**
  26       * Error details that should not be part of the main exception message,
  27       * e.g. any additional debugging information.
  28       *
  29       * @var string
  30       */
  31      public $details;
  32  
  33      /**
  34       * Has this exception been logged?
  35       *
  36       * @var boolean
  37       */
  38      public $logged = false;
  39  
  40      /**
  41       * The log level to use. A Horde_Log constant.
  42       *
  43       * @var integer
  44       */
  45      protected $_logLevel = 0;
  46  
  47      /**
  48       * Get the log level.
  49       *
  50       * @return integer  The Horde_Log constant for the log level.
  51       */
  52      public function getLogLevel()
  53      {
  54          return $this->_logLevel;
  55      }
  56  
  57      /**
  58       * Sets the log level.
  59       *
  60       * @param mixed $level  The log level.
  61       */
  62      public function setLogLevel($level = 0)
  63      {
  64          if (is_string($level)) {
  65              $level = defined('Horde_Log::' . $level)
  66                  ? constant('Horde_Log::' . $level)
  67                  : 0;
  68          }
  69  
  70          $this->_logLevel = $level;
  71      }
  72  
  73  }