dolibarr/htdocs/core/modules/syslog/logHandler.php

108 lines
2.1 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*/
2015-01-06 17:54:36 +01:00
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
2015-01-06 17:54:36 +01:00
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandlerInterface.php';
/**
* Parent class for log handlers
*/
class LogHandler
{
protected $ident = 0;
/**
* @var string[] Array of errors messages
*/
public $errors = [];
/**
* Content of the info tooltip.
*
* @return string
*/
public function getInfo()
{
return '';
}
/**
* Return warning if something is wrong with logger
*
* @return string
*/
public function getWarning()
{
return '';
}
2019-09-23 21:55:30 +02:00
/**
2012-10-22 00:43:59 +02:00
* Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
*
* @return string
*/
public function getVersion()
{
2012-10-22 00:43:59 +02:00
return 'development';
}
/**
2024-02-18 15:01:19 +01:00
* Is the logger active ?
*
2024-02-18 15:01:19 +01:00
* @return int 1 if logger enabled
*/
public function isActive()
{
2024-02-18 15:01:19 +01:00
return 0;
}
/**
* Configuration variables of the module
*
* @return array
*/
public function configure()
{
return array();
}
/**
* Function that checks if the configuration is valid.
* It will be called after setting the configuration.
* The function returns an array with error messages
*
* @return bool
*/
public function checkConfiguration()
{
return true;
}
/**
* Set current ident.
*
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
* @return void
*/
public function setIdent($ident)
{
$this->ident += $ident;
}
2019-02-03 15:21:21 +01:00
}