diff options
author | Kenny Katzgrau <katzgrau@gmail.com> | 2010-12-11 22:51:24 -0500 |
---|---|---|
committer | Kenny Katzgrau <katzgrau@gmail.com> | 2010-12-11 22:51:24 -0500 |
commit | 997cf5dea9f522b6980d1dc0a718d773954644ea (patch) | |
tree | 439901f8dd1dc5a0b0bf22dd55901cc79638d6b2 | |
parent | cb8b85365f39d58dd4179ec0ff3aed2b25202677 (diff) | |
download | KLogger-997cf5dea9f522b6980d1dc0a718d773954644ea.zip KLogger-997cf5dea9f522b6980d1dc0a718d773954644ea.tar.gz KLogger-997cf5dea9f522b6980d1dc0a718d773954644ea.tar.bz2 |
Fixed a minor undef-array-index bug, updated readme
-rw-r--r-- | README.markdown | 24 | ||||
-rwxr-xr-x | src/KLogger.php | 2 |
2 files changed, 9 insertions, 17 deletions
diff --git a/README.markdown b/README.markdown index 1eac80d..2fd6387 100644 --- a/README.markdown +++ b/README.markdown @@ -18,24 +18,16 @@ This github project will host the development of the next version of KLogger. The original version of KLogger is tagged as version 0.1, and is available for download [here](http://github.com/katzgrau/KLogger/downloads). +## Basic Usage + + $log = new KLogger('/var/log/'); # Specify the log directory + $log->logInfo('Returned a million search results'); //Prints to the log file + $log->logFatal('Oh dear.'); //Prints to the log file + ## Goals -KLogger's API will change for the better for it's 1.0 release. Expected changes -include: - - * Adherence to the Zend Coding Standards for PHP (right now, KLogger has a - .NET-ish member and method naming convention). The names of private - methods will be prefixed with '_' and camel-cased, for example. - * The implementation of a singleton pattern. A logger is likely needed in - many parts of an application — there should be no need to instantiate - multiple instances. You'll probably see: `$log = KLogger::instance();` in - the near future. - * Implementation of rolling log files. I've debated whether log files should - based on simply the date, or both the date size of the log file. I'm - thinking just the date will be sufficient to start. - * Put KLogger under a specific license (which will happen below) - * Have a bit more encapsulation of class members (and erase my cheeky - comments about not having encapsulation) +All of KLogger's internal goals have been met (there used to be a list here). +If you have a feature request, send it to katzgrau@gmail.com ## Why use KLogger? diff --git a/src/KLogger.php b/src/KLogger.php index 3760771..b4e945e 100755 --- a/src/KLogger.php +++ b/src/KLogger.php @@ -127,7 +127,7 @@ class KLogger if ($logDirectory === false) {
if (count(self::$instances) > 0) {
- return self::$instances[0];
+ return current(self::$instances);
} else {
$logDirectory = dirname(__FILE__);
}
|