summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Katzgrau <katzgrau@gmail.com>2010-12-11 22:51:39 -0500
committerKenny Katzgrau <katzgrau@gmail.com>2010-12-11 22:51:39 -0500
commitb6590e4a6840982e239900da7cc2ae71110998b5 (patch)
tree75dbfee22b562710879daf6a945aec5458995bdd
parent997cf5dea9f522b6980d1dc0a718d773954644ea (diff)
parente27b83ef3d913e205fdb6b887c79b8f0549e6ffb (diff)
downloadKLogger-b6590e4a6840982e239900da7cc2ae71110998b5.zip
KLogger-b6590e4a6840982e239900da7cc2ae71110998b5.tar.gz
KLogger-b6590e4a6840982e239900da7cc2ae71110998b5.tar.bz2
Merge branch 'master' of github.com:katzgrau/KLogger
-rw-r--r--README.markdown3
-rwxr-xr-xexample/example.php15
-rwxr-xr-xsrc/KLogger.php8
3 files changed, 21 insertions, 5 deletions
diff --git a/README.markdown b/README.markdown
index 2fd6387..4b61183 100644
--- a/README.markdown
+++ b/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
diff --git a/example/example.php b/example/example.php
new file mode 100755
index 0000000..efbc317
--- /dev/null
+++ b/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');
diff --git a/src/KLogger.php b/src/KLogger.php
index b4e945e..00ce4e5 100755
--- a/src/KLogger.php
+++ b/src/KLogger.php
@@ -321,7 +321,7 @@ class KLogger
*/
public function logCrit($line)
{
- $this->log($line, self::FATAL);
+ $this->log($line, self::CRIT);
}
/**
@@ -343,7 +343,7 @@ class KLogger
*/
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 @@ class KLogger
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 @@ class KLogger
return "$time - DEBUG -->";
case self::ERR:
return "$time - ERROR -->";
- case self::FATAL:
- return "$time - FATAL -->";
default:
return "$time - LOG -->";
}