File: Exception.php

package info (click to toggle)
php-horde-exception 2.0.8-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 588 kB
  • sloc: xml: 679; php: 284; sh: 3; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
 * Horde base exception class.
 *
 * Copyright 2008-2016 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
 *
 * @category Horde
 * @license  http://www.horde.org/licenses/lgpl21 LGPL-2.1
 * @package  Exception
 */
class Horde_Exception extends Exception
{
    /**
     * Error details that should not be part of the main exception message,
     * e.g. any additional debugging information.
     *
     * @var string
     */
    public $details;

    /**
     * Has this exception been logged?
     *
     * @var boolean
     */
    public $logged = false;

    /**
     * The log level to use. A Horde_Log constant.
     *
     * @var integer
     */
    protected $_logLevel = 0;

    /**
     * Get the log level.
     *
     * @return integer  The Horde_Log constant for the log level.
     */
    public function getLogLevel()
    {
        return $this->_logLevel;
    }

    /**
     * Sets the log level.
     *
     * @param mixed $level  The log level.
     */
    public function setLogLevel($level = 0)
    {
        if (is_string($level)) {
            $level = defined('Horde_Log::' . $level)
                ? constant('Horde_Log::' . $level)
                : 0;
        }

        $this->_logLevel = $level;
    }

}