1 | <?php |
||
24 | trait Log |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * The PSR-3 Logging object we're using |
||
29 | * |
||
30 | * @var \Monolog\Logger |
||
31 | */ |
||
32 | private $logger = null; |
||
33 | |||
34 | /** |
||
35 | * The path to where we're logging files |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | private $log_path = null; |
||
40 | |||
41 | /** |
||
42 | * Logs a generic error |
||
43 | * |
||
44 | * @param string $error |
||
45 | * @return \Monolog\Boolean |
||
46 | */ |
||
47 | public function logWarning($error) |
||
51 | |||
52 | /** |
||
53 | * Logs a debug error |
||
54 | * |
||
55 | * @param string $error |
||
56 | * @return \Monolog\Boolean |
||
57 | */ |
||
58 | public function logDebug($error) |
||
62 | |||
63 | /** |
||
64 | * Logs an error |
||
65 | * |
||
66 | * @param string $error |
||
67 | * @return \Monolog\Boolean |
||
68 | */ |
||
69 | public function logError($error) |
||
73 | |||
74 | /** |
||
75 | * Logs an emergency instance |
||
76 | * |
||
77 | * @param unknown $error |
||
78 | * @return \Monolog\Boolean |
||
79 | */ |
||
80 | public function logEmergency($error) |
||
84 | |||
85 | /** |
||
86 | * Returns an instance of the logger (creating one if it doesn't exist yet) |
||
87 | * |
||
88 | * @param string $name |
||
89 | * @return \Monolog\Logger |
||
90 | */ |
||
91 | public function getLogger($name = 'm62') |
||
107 | |||
108 | /** |
||
109 | * Returns the path to the log file |
||
110 | * |
||
111 | * @param string $name |
||
112 | * The name of the log file to use |
||
113 | * @return \mithra62\Traits::$log_path |
||
114 | */ |
||
115 | public function getPathToLogFile($name = 'm62') |
||
123 | |||
124 | /** |
||
125 | * Sets the path to the log file to use |
||
126 | * |
||
127 | * @param string $path |
||
128 | * The full path to the log file |
||
129 | * @return \mithra62\Traits\Log |
||
130 | */ |
||
131 | public function setPathToLogFile($path) |
||
137 | |||
138 | /** |
||
139 | * Removes the logging file |
||
140 | * |
||
141 | * @return \mithra62\Traits\Log |
||
142 | */ |
||
143 | public function removeLogFile() |
||
152 | } |