Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:katzgrau/KLogger

  • Loading branch information...
commit b6590e4a6840982e239900da7cc2ae71110998b5 2 parents 997cf5d + e27b83e
@katzgrau authored
Showing with 21 additions and 5 deletions.
  1. +2 −1  README.markdown
  2. +15 −0 example/example.php
  3. +4 −4 src/KLogger.php
View
3  README.markdown
@@ -48,8 +48,9 @@ Additionally, it's been used in numerous projects, both commercial and personal.
## Special Thanks
-Special thanks to all contributors, which right now includes one person:
+Special thanks to all contributors, which right now includes two people:
+[Tim Kinnane](http://twitter.com/etherealtim)
[Brian Fenton](http://github.com/fentie)
## License
View
15 example/example.php
@@ -0,0 +1,15 @@
+<?php
+
+# Should log to the same directory as this file
+require dirname(__FILE__) . '/../src/KLogger.php';
+
+$log = KLogger::instance(dirname(__FILE__), KLogger::DEBUG);
+
+$log->logInfo('Info Test');
+$log->logNotice('Notice Test');
+$log->logWarn('Warn Test');
+$log->logError('Error Test');
+$log->logFatal('Fatal Test');
+$log->logAlert('Alert Test');
+$log->logCrit('Crit test');
+$log->logEmerg('Emerg Test');
View
8 src/KLogger.php
@@ -321,7 +321,7 @@ public function logAlert($line)
*/
public function logCrit($line)
{
- $this->log($line, self::FATAL);
+ $this->log($line, self::CRIT);
}
/**
@@ -343,7 +343,7 @@ public function logEmerg($line)
*/
public function log($line, $severity)
{
- if ($this->_severityThreshold <= $severity) {
+ if ($this->_severityThreshold >= $severity) {
$status = $this->_getTimeLine($severity);
$this->writeFreeFormLine("$status $line \n");
}
@@ -376,6 +376,8 @@ private function _getTimeLine($level)
return "$time - ALERT -->";
case self::CRIT:
return "$time - CRIT -->";
+ case self::FATAL: # FATAL is an alias of CRIT
+ return "$time - FATAL -->";
case self::NOTICE:
return "$time - NOTICE -->";
case self::INFO:
@@ -386,8 +388,6 @@ private function _getTimeLine($level)
return "$time - DEBUG -->";
case self::ERR:
return "$time - ERROR -->";
- case self::FATAL:
- return "$time - FATAL -->";
default:
return "$time - LOG -->";
}

0 comments on commit b6590e4

Please sign in to comment.
Something went wrong with that request. Please try again.