Changeset 8500
- Timestamp:
- 04/17/08 09:32:08 (7 months ago)
- Files:
-
- branches/dwhittle/1.1/lib/action/sfComponent.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/controller/sfController.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/exception/sfException.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/helper/DebugHelper.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/log/sfLogger.class.php (modified) (5 diffs)
- branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/filter/sfFillInFormFilter.class.php (modified) (1 diff)
- branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/log/sfPropelLogger.class.php (modified) (2 diffs)
- branches/dwhittle/1.1/lib/view/sfView.class.php (modified) (1 diff)
- branches/dwhittle/1.1/test/unit/log/sfLoggerTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dwhittle/1.1/lib/action/sfComponent.class.php
r7454 r8500 143 143 if (sfConfig::get('sf_web_debug') && sfConfig::get('sf_logging_enabled')) 144 144 { 145 $this->dispatcher->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERR OR)));145 $this->dispatcher->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERR))); 146 146 } 147 147 } branches/dwhittle/1.1/lib/controller/sfController.class.php
r8467 r8500 397 397 if (sfConfig::get('sf_logging_enabled')) 398 398 { 399 $this->dispatcher->notify(new sfEvent($this, 'application.log', array('sendEmail method is deprecated', 'priority' => sfLogger::ERR OR)));399 $this->dispatcher->notify(new sfEvent($this, 'application.log', array('sendEmail method is deprecated', 'priority' => sfLogger::ERR))); 400 400 } 401 401 branches/dwhittle/1.1/lib/exception/sfException.class.php
r8367 r8500 117 117 if (sfConfig::get('sf_logging_enabled')) 118 118 { 119 $dispatcher->notify(new sfEvent($exception, 'application.log', array($exception->getMessage(), 'priority' => sfLogger::ERR OR)));119 $dispatcher->notify(new sfEvent($exception, 'application.log', array($exception->getMessage(), 'priority' => sfLogger::ERR))); 120 120 } 121 121 branches/dwhittle/1.1/lib/helper/DebugHelper.php
r7775 r8500 5 5 if (sfConfig::get('sf_web_debug') && sfConfig::get('sf_logging_enabled')) 6 6 { 7 sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERR OR)));7 sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERR))); 8 8 } 9 9 } branches/dwhittle/1.1/lib/log/sfLogger.class.php
r7782 r8500 26 26 * @author Fabien Potencier <fabien.potencier@symfony-project.com> 27 27 * @version SVN: $Id$ 28 * @todo Switch from pear error constants to more verbose 28 29 */ 29 30 abstract class sfLogger … … 31 32 const FATAL = 0; // System is unusable 32 33 const ALERT = 1; // Immediate action required 33 const CRIT ICAL= 2; // Critical conditions34 const ERR OR= 3; // Error conditions34 const CRIT = 2; // Critical conditions 35 const ERR = 3; // Error conditions 35 36 const WARNING = 4; // Warning conditions 36 37 const NOTICE = 5; // Normal but significant … … 156 157 public function critical($message) 157 158 { 158 $this->log($message, self::CRIT ICAL);159 $this->log($message, self::CRIT); 159 160 } 160 161 … … 166 167 public function error($message) 167 168 { 168 $this->log($message, self::ERR OR);169 $this->log($message, self::ERR); 169 170 } 170 171 … … 249 250 self::FATAL => 'fatal', 250 251 self::ALERT => 'alert', 251 self::CRIT ICAL=> 'critical',252 self::ERR OR=> 'error',252 self::CRIT => 'critical', 253 self::ERR => 'error', 253 254 self::WARNING => 'warning', 254 255 self::NOTICE => 'notice', branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/filter/sfFillInFormFilter.class.php
r6039 r8500 60 60 if (sfConfig::get('sf_logging_enabled')) 61 61 { 62 $this->context->getEventDispatcher()->notify(new sfEvent($this, 'application.log', array($e->getMessage(), 'priority' => sfLogger::ERR OR)));62 $this->context->getEventDispatcher()->notify(new sfEvent($this, 'application.log', array($e->getMessage(), 'priority' => sfLogger::ERR))); 63 63 } 64 64 } branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/log/sfPropelLogger.class.php
r7680 r8500 56 56 public function crit($message) 57 57 { 58 $this->log($message, sfLogger::CRIT ICAL);58 $this->log($message, sfLogger::CRIT); 59 59 } 60 60 … … 66 66 public function err($message) 67 67 { 68 $this->log($message, sfLogger::ERR OR);68 $this->log($message, sfLogger::ERR); 69 69 } 70 70 branches/dwhittle/1.1/lib/view/sfView.class.php
r8359 r8500 152 152 if ('both' === sfConfig::get('sf_escaping_strategy')) 153 153 { 154 $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "both" is deprecated, please use "on".', 'priority' => sfLogger::ERR OR)));154 $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "both" is deprecated, please use "on".', 'priority' => sfLogger::ERR))); 155 155 sfConfig::set('sf_escaping_strategy', 'on'); 156 156 } 157 157 else if ('bc' === sfConfig::get('sf_escaping_strategy')) 158 158 { 159 $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "bc" is deprecated, please use "off".', 'priority' => sfLogger::ERR OR)));159 $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "bc" is deprecated, please use "off".', 'priority' => sfLogger::ERR))); 160 160 sfConfig::set('sf_escaping_strategy', 'off'); 161 161 } branches/dwhittle/1.1/test/unit/log/sfLoggerTest.php
r4963 r8500 36 36 $t->is($logger->getLogLevel(), sfLogger::WARNING, '->setLogLevel() sets the log level'); 37 37 $logger->setLogLevel('error'); 38 $t->is($logger->getLogLevel(), sfLogger::ERR OR, '->setLogLevel() accepts a class constant or a string as its argument');38 $t->is($logger->getLogLevel(), sfLogger::ERR, '->setLogLevel() accepts a class constant or a string as its argument'); 39 39 40 40 // ->initialize() 41 41 $t->diag('->initialize()'); 42 $logger->initialize($dispatcher, array('level' => sfLogger::ERR OR));43 $t->is($logger->getLogLevel(), sfLogger::ERR OR, '->initialize() takes an array of parameters as its second argument');42 $logger->initialize($dispatcher, array('level' => sfLogger::ERR)); 43 $t->is($logger->getLogLevel(), sfLogger::ERR, '->initialize() takes an array of parameters as its second argument'); 44 44 45 45 // ::getPriorityName() … … 64 64 // log level 65 65 $t->diag('log levels'); 66 foreach (array('fatal', 'alert', 'crit ical', 'error', 'warning', 'notice', 'info', 'debug') as $level)66 foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $level) 67 67 { 68 68 $levelConstant = 'sfLogger::'.strtoupper($level); 69 69 70 foreach (array('fatal', 'alert', 'crit ical', 'error', 'warning', 'notice', 'info', 'debug') as $logLevel)70 foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $logLevel) 71 71 { 72 72 $logLevelConstant = 'sfLogger::'.strtoupper($logLevel); … … 82 82 // shortcuts 83 83 $t->diag('log shortcuts'); 84 foreach (array('fatal', 'alert', 'crit ical', 'error', 'warning', 'notice', 'info', 'debug') as $level)84 foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $level) 85 85 { 86 86 $levelConstant = 'sfLogger::'.strtoupper($level); 87 87 88 foreach (array('fatal', 'alert', 'crit ical', 'error', 'warning', 'notice', 'info', 'debug') as $logLevel)88 foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $logLevel) 89 89 { 90 90 $logger->setLogLevel(constant('sfLogger::'.strtoupper($logLevel)));