1 <?php
defined('IN_CMS') or die('No direct access allowed.');
5 public static function write($severity, $message) {
6 if(Config
::get('error.log') === false) {
10 $line = '[' . $severity . '] --> ' . $message . PHP_EOL
;
12 if($fp = @fopen
(PATH
. 'system/logs/' . date("Y-m-d") . '.log', 'a+')) {
18 public static function __callStatic($severity, $parameters) {
19 static::write($severity, $parameters[0]);
22 public static function exception($e) {
23 static::write('error', static::format($e));
26 private static function format($e) {
27 return $e->getMessage().' in '.$e->getFile().' on line '.$e->getLine();