From 6746f4e20168006fcb8709d0992bb7d5702d3b42 Mon Sep 17 00:00:00 2001 From: Alexander Kluth Date: Thu, 16 Jan 2014 11:31:11 +0100 Subject: [PATCH 1/4] Composer ready Signed-off-by: Alexander Kluth --- .gitignore | 2 ++ composer.json | 14 ++++++++++++++ src/{ => Katzgrau/KLogger}/KLogger.php | 14 +++++++------- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 composer.json rename src/{ => Katzgrau/KLogger}/KLogger.php (96%) diff --git a/.gitignore b/.gitignore index f2fdd26..c21a94b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ src/test.php test/ test/* test.php + +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..04c48dc --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "katzgrau/klogger", + "description": "A Simple Logging Class For PHP", + "license": "MIT", + "authors": [ + { + "name": "Kenny Katzgrau", + "email": "katzgrau@gmail.com" + } + ], + "require": { + + } +} diff --git a/src/KLogger.php b/src/Katzgrau/KLogger/KLogger.php similarity index 96% rename from src/KLogger.php rename to src/Katzgrau/KLogger/KLogger.php index 6766df3..3754da3 100755 --- a/src/KLogger.php +++ b/src/Katzgrau/KLogger/KLogger.php @@ -1,5 +1,5 @@ 0) { return current(self::$instances); @@ -239,7 +239,7 @@ public function clearMessages() /** * Sets the date format used by all instances of KLogger - * + * * @param string $dateFormat Valid format string for date() */ public static function setDateFormat($dateFormat) @@ -273,7 +273,7 @@ public function logNotice($line, $args = self::NO_ARGUMENTS) /** * Writes a $line to the log with a severity level of WARN. Generally - * corresponds to E_WARNING, E_USER_WARNING, E_CORE_WARNING, or + * corresponds to E_WARNING, E_USER_WARNING, E_CORE_WARNING, or * E_COMPILE_WARNING * * @param string $line Information to log @@ -352,14 +352,14 @@ public function log($line, $severity, $args = self::NO_ARGUMENTS) { if ($this->_severityThreshold >= $severity) { $status = $this->_getTimeLine($severity); - + $line = "$status $line"; - + if($args !== self::NO_ARGUMENTS) { /* Print the passed object value */ $line = $line . '; ' . var_export($args, true); } - + $this->writeFreeFormLine($line . PHP_EOL); } } From 99e5eb2df7676da4876a2b55a1ab711b486ac895 Mon Sep 17 00:00:00 2001 From: Alexander Kluth Date: Thu, 16 Jan 2014 11:50:21 +0100 Subject: [PATCH 2/4] Tested composer installation and autoloading Signed-off-by: Alexander Kluth --- composer.json | 3 +++ tests/composer.php | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/composer.php diff --git a/composer.json b/composer.json index 04c48dc..4c07b9c 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,9 @@ "email": "katzgrau@gmail.com" } ], + "autoload": { + "psr-0": { "Katzgrau\\KLogger": "src" } + }, "require": { } diff --git a/tests/composer.php b/tests/composer.php new file mode 100644 index 0000000..9dd8495 --- /dev/null +++ b/tests/composer.php @@ -0,0 +1,8 @@ +logInfo('Returned a million search results'); //Prints to the log file +$log->logFatal('Oh dear.'); //Prints to the log file From 4d33da86e8b02c95a74bc804fd093f601fe05665 Mon Sep 17 00:00:00 2001 From: Alexander Kluth Date: Thu, 16 Jan 2014 11:52:31 +0100 Subject: [PATCH 3/4] Updated README Signed-off-by: Alexander Kluth --- README.markdown | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index b068247..9835da0 100644 --- a/README.markdown +++ b/README.markdown @@ -18,9 +18,23 @@ 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). +## Installation + +Use [composer](http://getcomposer.org) and add KLogger to your composer.json to use it: + + require: { + ... + "katzgrau/klogger": "*", + ... + } + +Then hit `composer install` to get KLogger. + ## Basic Usage - $log = new KLogger('/var/log/'); # Specify the log directory + use Katzgrau\KLogger\Klogger; + + $log = new KLogger('/tmp/', KLogger::INFO); # Specify the log directory and minimum severity level $log->logInfo('Returned a million search results'); //Prints to the log file $log->logFatal('Oh dear.'); //Prints to the log file $log->logInfo('Here is an object', $obj); //Prints to the log file with a dump of the object From e3c9a467cb6a85470c6dbd13d9f04441675afefe Mon Sep 17 00:00:00 2001 From: Alexander Kluth Date: Fri, 24 Jan 2014 10:35:45 +0100 Subject: [PATCH 4/4] Repository rename Signed-off-by: Alexander Kluth --- README.markdown | 66 +-- composer.json | 13 +- composer.lock | 386 ++++++++++++++++++ .../EKLogger/EKLogger.php} | 86 ++-- 4 files changed, 441 insertions(+), 110 deletions(-) create mode 100644 composer.lock rename src/{Katzgrau/KLogger/KLogger.php => DerAlex/EKLogger/EKLogger.php} (79%) diff --git a/README.markdown b/README.markdown index 9835da0..cf15cb4 100644 --- a/README.markdown +++ b/README.markdown @@ -1,78 +1,44 @@ -# KLogger: A Simple Logging Class For PHP +# eklogger: A logging class for PHP -A project written by Kenny Katzgrau and originally hosted at -[CodeFury.net](http://codefury.net/projects/klogger/). This marks the -development of a newer version of KLogger. +eklogger is a simple yet powerful logging class for PHP + +eklogger is based on [KLogger](https://github.com/katzgrau/Klogger) written by +[Kenny Katzgrau](http://codefury.net/projects/klogger/). ## About -KLogger is an easy-to-use logging class for PHP. It supports standard log levels +eklogger is an easy-to-use logging class for PHP. It supports standard log levels like debug, info, warn, error, and fatal. Additionally, it isn't naive about -file permissions (which is expected). It was meant to be a class that you could -quickly include into a project and have working right away. - -The class was written in 2008, but I have since received a number of emails both -saying 'thanks' and asking me to add features. +file permissions (which is expected). It also provides output to STDOUT. -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). ## Installation -Use [composer](http://getcomposer.org) and add KLogger to your composer.json to use it: +Use [composer](http://getcomposer.org) and add eklogger to your composer.json to use it: require: { ... - "katzgrau/klogger": "*", + "deralex/eklogger": "*", ... } -Then hit `composer install` to get KLogger. +Then hit `composer install` to get eklogger. ## Basic Usage - use Katzgrau\KLogger\Klogger; - - $log = new KLogger('/tmp/', KLogger::INFO); # Specify the log directory and minimum severity level - $log->logInfo('Returned a million search results'); //Prints to the log file - $log->logFatal('Oh dear.'); //Prints to the log file - $log->logInfo('Here is an object', $obj); //Prints to the log file with a dump of the object - -## Goals - -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? - -Why not? Just drop it in and go. If it saves you time and does what you need, -go for it! Take a line from the book of our C-code fathers: "`build` upon the -work of others". - -## Who uses KLogger? - -Klogger has been used in projects at: - - * The University of Iowa - * The University of Laverne - * The New Jersey Institute of Technology - * Middlesex Hospital in NJ - -Additionally, it's been used in numerous projects, both commercial and personal. - -## Special Thanks + use DerAlex\eklogger\EKLogger; -Special thanks to all contributors, which right now includes three people: + $log = new EKLogger('/tmp/', EKLogger::INFO); # Specify the log directory and minimum severity level + $log->info('Returned a million search results'); //Prints to the log file + $log->fatal('Oh dear.'); //Prints to the log file + $log->info('Here is an object', $obj); //Prints to the log file with a dump of the object -[Tim Kinnane](http://twitter.com/etherealtim) -[Brian Fenton](http://github.com/fentie) -[Cameron Will](https://github.com/cwill747) ## License The MIT License +Copyright (c) 2014 Alexander Kluth Copyright (c) 2008-2010 Kenny Katzgrau Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/composer.json b/composer.json index 4c07b9c..2c23b76 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,24 @@ { - "name": "katzgrau/klogger", - "description": "A Simple Logging Class For PHP", + "name": "deralex/eklogger", + "description": "A simple yet powerful logging class", "license": "MIT", "authors": [ + { + "name": "Alexander Kluth", + "email": "contact@alexanderkluth.com" + }, { "name": "Kenny Katzgrau", "email": "katzgrau@gmail.com" } ], "autoload": { - "psr-0": { "Katzgrau\\KLogger": "src" } + "psr-0": { "DerAlex\\EKLogger": "src" } }, "require": { + }, + "require-dev": { + "phpspec/phpspec": "2.0.x-dev" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..84a806b --- /dev/null +++ b/composer.lock @@ -0,0 +1,386 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + ], + "hash": "b8bf46c59a10b43e7e30242be6df0053", + "packages": [ + + ], + "packages-dev": [ + { + "name": "phpspec/php-diff", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/phpspec/php-diff.git", + "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", + "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Diff": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Chris Boulton", + "homepage": "http://github.com/chrisboulton" + } + ], + "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", + "time": "2013-11-01 13:02:21" + }, + { + "name": "phpspec/phpspec", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpspec/phpspec.git", + "reference": "59d1e207c19f97edeb9673e45a285b28d1852711" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/phpspec/zipball/59d1e207c19f97edeb9673e45a285b28d1852711", + "reference": "59d1e207c19f97edeb9673e45a285b28d1852711", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpspec/php-diff": "~1.0.0", + "phpspec/prophecy": "~1.1", + "symfony/console": "~2.1", + "symfony/event-dispatcher": "~2.1", + "symfony/finder": "~2.1", + "symfony/yaml": "~2.1" + }, + "require-dev": { + "behat/behat": "~2.5", + "bossa/phpspec2-expect": "dev-master" + }, + "suggest": { + "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" + }, + "bin": [ + "bin/phpspec" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "PhpSpec": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "homepage": "http://marcelloduarte.net/" + } + ], + "description": "Specification-oriented BDD framework for PHP 5.3+", + "homepage": "http://phpspec.net/", + "keywords": [ + "BDD", + "SpecBDD", + "TDD", + "spec", + "specification", + "testing", + "tests" + ], + "time": "2014-01-23 23:03:41" + }, + { + "name": "phpspec/prophecy", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "fc5ddee4879dfcee788d9cb4b92af9028bc3d7e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/fc5ddee4879dfcee788d9cb4b92af9028bc3d7e8", + "reference": "fc5ddee4879dfcee788d9cb4b92af9028bc3d7e8", + "shasum": "" + }, + "require-dev": { + "phpspec/phpspec": "2.0.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "http://phpspec.org", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2014-01-15 15:06:06" + }, + { + "name": "symfony/console", + "version": "v2.4.1", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "4c1ed2ff514bd85ee186eebb010ccbdeeab05af7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/4c1ed2ff514bd85ee186eebb010ccbdeeab05af7", + "reference": "4c1ed2ff514bd85ee186eebb010ccbdeeab05af7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/event-dispatcher": "~2.1" + }, + "suggest": { + "symfony/event-dispatcher": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2014-01-01 08:14:50" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.4.1", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "e3ba42f6a70554ed05749e61b829550f6ac33601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e3ba42f6a70554ed05749e61b829550f6ac33601", + "reference": "e3ba42f6a70554ed05749e61b829550f6ac33601", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~2.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2013-12-28 08:12:03" + }, + { + "name": "symfony/finder", + "version": "v2.4.1", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "6904345cf2b3bbab1f6d6e4ce1724cb99df9f00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/6904345cf2b3bbab1f6d6e4ce1724cb99df9f00a", + "reference": "6904345cf2b3bbab1f6d6e4ce1724cb99df9f00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com", + "time": "2014-01-01 08:14:50" + }, + { + "name": "symfony/yaml", + "version": "v2.4.1", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "4e1a237fc48145fae114b96458d799746ad89aa0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4e1a237fc48145fae114b96458d799746ad89aa0", + "reference": "4e1a237fc48145fae114b96458d799746ad89aa0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2013-12-28 08:12:03" + } + ], + "aliases": [ + + ], + "minimum-stability": "stable", + "stability-flags": { + "phpspec/phpspec": 20 + }, + "platform": [ + + ], + "platform-dev": [ + + ] +} diff --git a/src/Katzgrau/KLogger/KLogger.php b/src/DerAlex/EKLogger/EKLogger.php similarity index 79% rename from src/Katzgrau/KLogger/KLogger.php rename to src/DerAlex/EKLogger/EKLogger.php index 3754da3..76bb534 100755 --- a/src/Katzgrau/KLogger/KLogger.php +++ b/src/DerAlex/EKLogger/EKLogger.php @@ -1,26 +1,8 @@ logInfo('Returned a million search results'); //Prints to the log file - * $log->logFatal('Oh dear.'); //Prints to the log file - * $log->logDebug('x = 5'); //Prints nothing due to current severity threshhold - * - * @author Kenny Katzgrau - * @since July 26, 2008 — Last update July 1, 2012 - * @link http://codefury.net - * @version 0.2.0 - */ - -/** - * Class documentation - */ -class KLogger +namespace DerAlex\EKLogger; + + +class EKLogger { /** * Error severity, from low to high. From BSD syslog RFC, secion 4.1.1 @@ -40,11 +22,6 @@ class KLogger * Log nothing at all */ const OFF = 8; - /** - * Alias for CRIT - * @deprecated - */ - const FATAL = 2; /** * Internal status codes @@ -122,9 +99,9 @@ class KLogger * Partially implements the Singleton pattern. Each $logDirectory gets one * instance. * - * @param string $logDirectory File path to the logging directory - * @param integer $severity One of the pre-defined severity constants - * @return KLogger + * @param bool|string $logDirectory File path to the logging directory + * @param bool|int $severity One of the pre-defined severity constants + * @return EKLogger */ public static function instance($logDirectory = false, $severity = false) { @@ -152,9 +129,9 @@ public static function instance($logDirectory = false, $severity = false) /** * Class constructor * - * @param string $logDirectory File path to the logging directory - * @param integer $severity One of the pre-defined severity constants - * @return void + * @param string $logDirectory File path to the logging directory + * @param integer $severity One of the pre-defined severity constants + * @return \DerAlex\EKLogger\EKLogger */ public function __construct($logDirectory, $severity) { @@ -199,13 +176,15 @@ public function __destruct() fclose($this->_fileHandle); } } + /** * Writes a $line to the log with a severity level of DEBUG * * @param string $line Information to log + * @param string $args * @return void */ - public function logDebug($line, $args = self::NO_ARGUMENTS) + public function debug($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::DEBUG); } @@ -252,9 +231,10 @@ public static function setDateFormat($dateFormat) * can be used here, or it could be used with E_STRICT errors * * @param string $line Information to log + * @param string $args * @return void */ - public function logInfo($line, $args = self::NO_ARGUMENTS) + public function info($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::INFO, $args); } @@ -264,9 +244,10 @@ public function logInfo($line, $args = self::NO_ARGUMENTS) * corresponds to E_STRICT, E_NOTICE, or E_USER_NOTICE errors * * @param string $line Information to log + * @param string $args * @return void */ - public function logNotice($line, $args = self::NO_ARGUMENTS) + public function notice($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::NOTICE, $args); } @@ -277,9 +258,10 @@ public function logNotice($line, $args = self::NO_ARGUMENTS) * E_COMPILE_WARNING * * @param string $line Information to log + * @param string $args * @return void */ - public function logWarn($line, $args = self::NO_ARGUMENTS) + public function warn($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::WARN, $args); } @@ -289,33 +271,22 @@ public function logWarn($line, $args = self::NO_ARGUMENTS) * with E_RECOVERABLE_ERROR * * @param string $line Information to log + * @param string $args * @return void */ - public function logError($line, $args = self::NO_ARGUMENTS) + public function error($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::ERR, $args); } - /** - * Writes a $line to the log with a severity level of FATAL. Generally - * corresponds to E_ERROR, E_USER_ERROR, E_CORE_ERROR, or E_COMPILE_ERROR - * - * @param string $line Information to log - * @return void - * @deprecated Use logCrit - */ - public function logFatal($line, $args = self::NO_ARGUMENTS) - { - $this->log($line, self::FATAL, $args); - } - /** * Writes a $line to the log with a severity level of ALERT. * * @param string $line Information to log + * @param string $args * @return void */ - public function logAlert($line, $args = self::NO_ARGUMENTS) + public function alert($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::ALERT, $args); } @@ -324,9 +295,10 @@ public function logAlert($line, $args = self::NO_ARGUMENTS) * Writes a $line to the log with a severity level of CRIT. * * @param string $line Information to log + * @param string $args * @return void */ - public function logCrit($line, $args = self::NO_ARGUMENTS) + public function critical($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::CRIT, $args); } @@ -335,9 +307,10 @@ public function logCrit($line, $args = self::NO_ARGUMENTS) * Writes a $line to the log with a severity level of EMERG. * * @param string $line Information to log + * @param string $args * @return void */ - public function logEmerg($line, $args = self::NO_ARGUMENTS) + public function emergency($line, $args = self::NO_ARGUMENTS) { $this->log($line, self::EMERG, $args); } @@ -345,8 +318,9 @@ public function logEmerg($line, $args = self::NO_ARGUMENTS) /** * Writes a $line to the log with the given severity * - * @param string $line Text to add to the log + * @param string $line Text to add to the log * @param integer $severity Severity level of log message (use constants) + * @param string $args */ public function log($line, $severity, $args = self::NO_ARGUMENTS) { @@ -391,8 +365,6 @@ 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: