Plop
A simple logging library for PHP
LoggerAbstract.php
1 <?php
2 /*
3  This file is part of Plop, a simple logging library for PHP.
4 
5  Copyright © 2010-2014 François Poirotte
6 
7  Plop is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Plop is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Plop. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 namespace Plop;
22 
28 abstract class LoggerAbstract implements \Plop\LoggerInterface
29 {
31  public function debug(
32  $msg,
33  array $args = array(),
34  \Exception $exception = null
35  ) {
36  return $this->log(\Plop\DEBUG, $msg, $args, $exception);
37  }
38 
40  public function info(
41  $msg,
42  array $args = array(),
43  \Exception $exception = null
44  ) {
45  return $this->log(\Plop\INFO, $msg, $args, $exception);
46  }
47 
49  public function notice(
50  $msg,
51  array $args = array(),
52  \Exception $exception = null
53  ) {
54  return $this->log(\Plop\NOTICE, $msg, $args, $exception);
55  }
56 
58  public function warning(
59  $msg,
60  array $args = array(),
61  \Exception $exception = null
62  ) {
63  return $this->log(\Plop\WARNING, $msg, $args, $exception);
64  }
65 
67  public function warn(
68  $msg,
69  array $args = array(),
70  \Exception $exception = null
71  ) {
72  return $this->log(\Plop\WARN, $msg, $args, $exception);
73  }
74 
76  public function error(
77  $msg,
78  array $args = array(),
79  \Exception $exception = null
80  ) {
81  return $this->log(\Plop\ERROR, $msg, $args, $exception);
82  }
83 
85  public function critical(
86  $msg,
87  array $args = array(),
88  \Exception $exception = null
89  ) {
90  return $this->log(\Plop\CRITICAL, $msg, $args, $exception);
91  }
92 
94  public function alert(
95  $msg,
96  array $args = array(),
97  \Exception $exception = null
98  ) {
99  return $this->log(\Plop\ALERT, $msg, $args, $exception);
100  }
101 
103  public function emergency(
104  $msg,
105  array $args = array(),
106  \Exception $exception = null
107  ) {
108  return $this->log(\Plop\EMERGENCY, $msg, $args, $exception);
109  }
110 
112  public function exception(
113  $msg,
114  \Exception $exception,
115  array $args = array()
116  ) {
117  return $this->log(\Plop\ERROR, $msg, $args, $exception);
118  }
119 }
notice($msg, array $args=array(),\Exception $exception=null)
debug($msg, array $args=array(),\Exception $exception=null)
An abstract class that can be used as a base to create new loggers.
emergency($msg, array $args=array(),\Exception $exception=null)
info($msg, array $args=array(),\Exception $exception=null)
exception($msg,\Exception $exception, array $args=array())
alert($msg, array $args=array(),\Exception $exception=null)
warning($msg, array $args=array(),\Exception $exception=null)
error($msg, array $args=array(),\Exception $exception=null)
Interface for a logger.
This exception is thrown by Plop whenever a problem is detected.
Definition: Exception.php:30
critical($msg, array $args=array(),\Exception $exception=null)
warn($msg, array $args=array(),\Exception $exception=null)