logHandler.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandlerInterface.php';
  18. /**
  19. * Parent class for log handlers
  20. */
  21. class LogHandler
  22. {
  23. protected $ident = 0;
  24. /**
  25. * Content of the info tooltip.
  26. *
  27. * @return string
  28. */
  29. public function getInfo()
  30. {
  31. return '';
  32. }
  33. /**
  34. * Return warning if something is wrong with logger
  35. *
  36. * @return string
  37. */
  38. public function getWarning()
  39. {
  40. return '';
  41. }
  42. /**
  43. * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
  44. *
  45. * @return string
  46. */
  47. public function getVersion()
  48. {
  49. return 'development';
  50. }
  51. /**
  52. * Is the module active ?
  53. *
  54. * @return boolean
  55. */
  56. public function isActive()
  57. {
  58. return false;
  59. }
  60. /**
  61. * Configuration variables of the module
  62. *
  63. * @return array
  64. */
  65. public function configure()
  66. {
  67. return array();
  68. }
  69. /**
  70. * Function that checks if the configuration is valid.
  71. * It will be called after setting the configuration.
  72. * The function returns an array with error messages
  73. *
  74. * @return array
  75. */
  76. public function checkConfiguration()
  77. {
  78. return array();
  79. }
  80. /**
  81. * Set current ident.
  82. *
  83. * @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
  84. * @return void
  85. */
  86. public function setIdent($ident)
  87. {
  88. $this->ident += $ident;
  89. }
  90. }