dolibarr  21.0.0-alpha
logHandler.php
1 <?php
2 /* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
3  * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
4  */
5 /*
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  * or see https://www.gnu.org/
19  */
20 
24 abstract class LogHandler
25 {
29  public $code;
30 
31  protected $ident = 0;
32 
36  public $errors = [];
37 
38 
44  public function getName()
45  {
46  return ucfirst($this->code);
47  }
48 
54  public function getInfo()
55  {
56  return '';
57  }
58 
64  public function getWarning()
65  {
66  return '';
67  }
68 
74  public function getVersion()
75  {
76  return 'development';
77  }
78 
84  public function isActive()
85  {
86  return 0;
87  }
88 
94  public function configure()
95  {
96  return array();
97  }
98 
106  public function checkConfiguration()
107  {
108  return true;
109  }
110 
117  public function setIdent($ident)
118  {
119  $this->ident += $ident;
120  }
121 
129  public function export($content, $suffixinfilename = '')
130  {
131  // Code to output log
132  return;
133  }
134 }
Parent class for log handlers.
Definition: logHandler.php:25
getInfo()
Content of the info tooltip.
Definition: logHandler.php:54
checkConfiguration()
Function that checks if the configuration is valid.
Definition: logHandler.php:106
getVersion()
Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
Definition: logHandler.php:74
export($content, $suffixinfilename='')
Export the message.
Definition: logHandler.php:129
configure()
Configuration variables of the module.
Definition: logHandler.php:94
getWarning()
Return warning if something is wrong with logger.
Definition: logHandler.php:64
getName()
Return name of logger.
Definition: logHandler.php:44
isActive()
Is the logger active ?
Definition: logHandler.php:84
setIdent($ident)
Set current ident.
Definition: logHandler.php:117
print *****$script_file(".$version.") pid code
1: frais de port 2: ecotaxe 3: option line (when qty = 0)