Development

Changeset 8500

You must first sign up to be able to contribute.

Changeset 8500

Show
Ignore:
Timestamp:
04/17/08 09:32:08 (7 months ago)
Author:
dwhittle
Message:

dwhittle: changed sfLogger ::ERROR to ::ERR and ::CRITICAL to ::CRIT (to be pear / 1.1 compliant)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.1/lib/action/sfComponent.class.php

    r7454 r8500  
    143143    if (sfConfig::get('sf_web_debug') && sfConfig::get('sf_logging_enabled')) 
    144144    { 
    145       $this->dispatcher->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERROR))); 
     145      $this->dispatcher->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERR))); 
    146146    } 
    147147  } 
  • branches/dwhittle/1.1/lib/controller/sfController.class.php

    r8467 r8500  
    397397    if (sfConfig::get('sf_logging_enabled')) 
    398398    { 
    399       $this->dispatcher->notify(new sfEvent($this, 'application.log', array('sendEmail method is deprecated', 'priority' => sfLogger::ERROR))); 
     399      $this->dispatcher->notify(new sfEvent($this, 'application.log', array('sendEmail method is deprecated', 'priority' => sfLogger::ERR))); 
    400400    } 
    401401 
  • branches/dwhittle/1.1/lib/exception/sfException.class.php

    r8367 r8500  
    117117      if (sfConfig::get('sf_logging_enabled')) 
    118118      { 
    119         $dispatcher->notify(new sfEvent($exception, 'application.log', array($exception->getMessage(), 'priority' => sfLogger::ERROR))); 
     119        $dispatcher->notify(new sfEvent($exception, 'application.log', array($exception->getMessage(), 'priority' => sfLogger::ERR))); 
    120120      } 
    121121 
  • branches/dwhittle/1.1/lib/helper/DebugHelper.php

    r7775 r8500  
    55  if (sfConfig::get('sf_web_debug') && sfConfig::get('sf_logging_enabled')) 
    66  { 
    7     sfContext::getInstance()->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array('This feature is deprecated in favor of the log_message helper.', 'priority' => sfLogger::ERROR))); 
     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))); 
    88  } 
    99} 
  • branches/dwhittle/1.1/lib/log/sfLogger.class.php

    r7782 r8500  
    2626 * @author     Fabien Potencier <fabien.potencier@symfony-project.com> 
    2727 * @version    SVN: $Id$ 
     28 * @todo       Switch from pear error constants to more verbose 
    2829 */ 
    2930abstract class sfLogger 
     
    3132  const FATAL     = 0; // System is unusable 
    3233  const ALERT     = 1; // Immediate action required 
    33   const CRITICAL  = 2; // Critical conditions 
    34   const ERROR     = 3; // Error conditions 
     34  const CRIT      = 2; // Critical conditions 
     35  const ERR       = 3; // Error conditions 
    3536  const WARNING   = 4; // Warning conditions 
    3637  const NOTICE    = 5; // Normal but significant 
     
    156157  public function critical($message) 
    157158  { 
    158     $this->log($message, self::CRITICAL); 
     159    $this->log($message, self::CRIT); 
    159160  } 
    160161 
     
    166167  public function error($message) 
    167168  { 
    168     $this->log($message, self::ERROR); 
     169    $this->log($message, self::ERR); 
    169170  } 
    170171 
     
    249250      self::FATAL    => 'fatal', 
    250251      self::ALERT    => 'alert', 
    251       self::CRITICAL => 'critical', 
    252       self::ERROR    => 'error', 
     252      self::CRIT    => 'critical', 
     253      self::ERR      => 'error', 
    253254      self::WARNING  => 'warning', 
    254255      self::NOTICE   => 'notice', 
  • branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/filter/sfFillInFormFilter.class.php

    r6039 r8500  
    6060      if (sfConfig::get('sf_logging_enabled')) 
    6161      { 
    62         $this->context->getEventDispatcher()->notify(new sfEvent($this, 'application.log', array($e->getMessage(), 'priority' => sfLogger::ERROR))); 
     62        $this->context->getEventDispatcher()->notify(new sfEvent($this, 'application.log', array($e->getMessage(), 'priority' => sfLogger::ERR))); 
    6363      } 
    6464    } 
  • branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/log/sfPropelLogger.class.php

    r7680 r8500  
    5656  public function crit($message) 
    5757  { 
    58     $this->log($message, sfLogger::CRITICAL); 
     58    $this->log($message, sfLogger::CRIT); 
    5959  } 
    6060 
     
    6666  public function err($message) 
    6767  { 
    68     $this->log($message, sfLogger::ERROR); 
     68    $this->log($message, sfLogger::ERR); 
    6969  } 
    7070 
  • branches/dwhittle/1.1/lib/view/sfView.class.php

    r8359 r8500  
    152152    if ('both' === sfConfig::get('sf_escaping_strategy')) 
    153153    { 
    154       $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "both" is deprecated, please use "on".', 'priority' => sfLogger::ERROR))); 
     154      $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "both" is deprecated, please use "on".', 'priority' => sfLogger::ERR))); 
    155155      sfConfig::set('sf_escaping_strategy', 'on'); 
    156156    } 
    157157    else if ('bc' === sfConfig::get('sf_escaping_strategy')) 
    158158    { 
    159       $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "bc" is deprecated, please use "off".', 'priority' => sfLogger::ERROR))); 
     159      $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Escaping strategy "bc" is deprecated, please use "off".', 'priority' => sfLogger::ERR))); 
    160160      sfConfig::set('sf_escaping_strategy', 'off'); 
    161161    } 
  • branches/dwhittle/1.1/test/unit/log/sfLoggerTest.php

    r4963 r8500  
    3636$t->is($logger->getLogLevel(), sfLogger::WARNING, '->setLogLevel() sets the log level'); 
    3737$logger->setLogLevel('error'); 
    38 $t->is($logger->getLogLevel(), sfLogger::ERROR, '->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'); 
    3939 
    4040// ->initialize() 
    4141$t->diag('->initialize()'); 
    42 $logger->initialize($dispatcher, array('level' => sfLogger::ERROR)); 
    43 $t->is($logger->getLogLevel(), sfLogger::ERROR, '->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'); 
    4444 
    4545// ::getPriorityName() 
     
    6464// log level 
    6565$t->diag('log levels'); 
    66 foreach (array('fatal', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug') as $level) 
     66foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $level) 
    6767{ 
    6868  $levelConstant = 'sfLogger::'.strtoupper($level); 
    6969 
    70   foreach (array('fatal', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug') as $logLevel) 
     70  foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $logLevel) 
    7171  { 
    7272    $logLevelConstant = 'sfLogger::'.strtoupper($logLevel); 
     
    8282// shortcuts 
    8383$t->diag('log shortcuts'); 
    84 foreach (array('fatal', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug') as $level) 
     84foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $level) 
    8585{ 
    8686  $levelConstant = 'sfLogger::'.strtoupper($level); 
    8787 
    88   foreach (array('fatal', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug') as $logLevel) 
     88  foreach (array('fatal', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug') as $logLevel) 
    8989  { 
    9090    $logger->setLogLevel(constant('sfLogger::'.strtoupper($logLevel)));