1<?php
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <https://www.gnu.org/licenses/>.
15 * or see https://www.gnu.org/
16 */
17
18require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandlerInterface.php';
19
20/**
21 * Parent class for log handlers
22 */
23class LogHandler
24{
25	protected $ident = 0;
26
27
28	/**
29	 * Content of the info tooltip.
30	 *
31	 * @return string
32	 */
33	public function getInfo()
34	{
35		return '';
36	}
37
38	/**
39	 * Return warning if something is wrong with logger
40	 *
41	 * @return string
42	 */
43	public function getWarning()
44	{
45		return '';
46	}
47
48	/**
49	 * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
50	 *
51	 * @return string
52	 */
53	public function getVersion()
54	{
55		return 'development';
56	}
57
58	/**
59	 * Is the module active ?
60	 *
61	 * @return boolean
62	 */
63	public function isActive()
64	{
65		return false;
66	}
67
68	/**
69	 * Configuration variables of the module
70	 *
71	 * @return array
72	 */
73	public function configure()
74	{
75		return array();
76	}
77
78	/**
79	 * Function that checks if the configuration is valid.
80	 * It will be called after setting the configuration.
81	 * The function returns an array with error messages
82	 *
83	 * @return array
84	 */
85	public function checkConfiguration()
86	{
87		return array();
88	}
89
90	/**
91	 * Set current ident.
92	 *
93	 * @param	int		$ident		1=Increase ident of 1, -1=Decrease ident of 1
94	 * @return 	void
95	 */
96	public function setIdent($ident)
97	{
98		$this->ident += $ident;
99	}
100}
101