'warning', LOG_NOTICE => 'notice', LOG_INFO => 'info', LOG_DEBUG => 'debug', LOG_ERR => 'error', LOG_ERROR => 'error' ); if (is_int($type) && isset($levels[$type])) { $type = $levels[$type]; } if ($type == 'error' || $type == 'warning') { $filename = LOGS . 'error.log'; } elseif (in_array($type, $levels)) { $filename = LOGS . 'debug.log'; } else { $filename = LOGS . $type . '.log'; } $output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $msg . "\n"; $log = new File($filename, true); if ($log->writable()) { return $log->append($output); } } } ?>