1<?php
2/**
3 * Horde base exception class.
4 *
5 * Copyright 2008-2016 Horde LLC (http://www.horde.org/)
6 *
7 * See the enclosed file COPYING for license information (LGPL). If you
8 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
9 *
10 * @category Horde
11 * @license  http://www.horde.org/licenses/lgpl21 LGPL-2.1
12 * @package  Exception
13 */
14class Horde_Exception extends Exception
15{
16    /**
17     * Error details that should not be part of the main exception message,
18     * e.g. any additional debugging information.
19     *
20     * @var string
21     */
22    public $details;
23
24    /**
25     * Has this exception been logged?
26     *
27     * @var boolean
28     */
29    public $logged = false;
30
31    /**
32     * The log level to use. A Horde_Log constant.
33     *
34     * @var integer
35     */
36    protected $_logLevel = 0;
37
38    /**
39     * Get the log level.
40     *
41     * @return integer  The Horde_Log constant for the log level.
42     */
43    public function getLogLevel()
44    {
45        return $this->_logLevel;
46    }
47
48    /**
49     * Sets the log level.
50     *
51     * @param mixed $level  The log level.
52     */
53    public function setLogLevel($level = 0)
54    {
55        if (is_string($level)) {
56            $level = defined('Horde_Log::' . $level)
57                ? constant('Horde_Log::' . $level)
58                : 0;
59        }
60
61        $this->_logLevel = $level;
62    }
63
64}
65