Changeset 144

Show
Ignore:
Timestamp:
02/05/07 15:19:00 (2 years ago)
Author:
hans
Message:

Closes #70: Create Project class constants for log levels (replacing PROJECT_MSG_*)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/phing/BuildEvent.php

    r123 r144  
    7676     *  @access private 
    7777     */ 
    78     protected $priority = PROJECT_MSG_VERBOSE; 
     78    protected $priority = Project::MSG_VERBOSE; 
    7979 
    8080    /** 
  • trunk/classes/phing/IntrospectionHelper.php

    r123 r144  
    353353         
    354354        try { 
    355             $project->log("    -calling setter ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", PROJECT_MSG_DEBUG); 
     355            $project->log("    -calling setter ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 
    356356            $method->invoke($element, $value); 
    357357        } catch(Exception $exc) { 
     
    392392            $method = $this->nestedCreators[$createMethod]; 
    393393             try { // try to invoke the creator method on object 
    394                 $project->log("    -calling creator ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", PROJECT_MSG_DEBUG); 
     394                $project->log("    -calling creator ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 
    395395                $nestedElement = $method->invoke($element); 
    396396            } catch (Exception $exc) { 
     
    406406            try { // try to invoke the adder method on object 
    407407             
    408                 $project->log("    -calling adder ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", PROJECT_MSG_DEBUG); 
     408                $project->log("    -calling adder ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 
    409409                // we've already assured that correct num of params 
    410410                // exist and that method is using class hints                 
     
    455455             
    456456            try {                                 
    457                 $project->log("    -calling storer ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", PROJECT_MSG_DEBUG);                     
     457                $project->log("    -calling storer ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG);                     
    458458                $method->invoke($element, $child);             
    459459            } catch (Exception $exc) { 
     
    535535     */ 
    536536    function warn($msg) { 
    537         if (Phing::getMsgOutputLevel() === PROJECT_MSG_DEBUG) { 
     537        if (Phing::getMsgOutputLevel() === Project::MSG_DEBUG) { 
    538538            print("[IntrospectionHelper] " . $msg . "\n"); 
    539539        } 
  • trunk/classes/phing/Phing.php

    r143 r144  
    6464    const DEFAULT_BUILD_FILENAME = "build.xml"; 
    6565         
    66     /** Our current message output status. Follows PROJECT_MSG_XXX */ 
    67     private static $msgOutputLevel = PROJECT_MSG_INFO; 
     66    /** Our current message output status. Follows Project::MSG_XXX */ 
     67    private static $msgOutputLevel = Project::MSG_INFO; 
    6868 
    6969    /** PhingFile that we are using for configuration */ 
     
    116116    function printMessage(Exception $t) { 
    117117        print($t->getMessage() . "\n"); 
    118         if (self::getMsgOutputLevel() === PROJECT_MSG_DEBUG) { 
     118        if (self::getMsgOutputLevel() === Project::MSG_DEBUG) { 
    119119            print($t->getTraceAsString()."\n"); 
    120120            if ($t instanceof Exception) {                 
     
    214214                return; 
    215215            } elseif ($arg == "-quiet" || $arg == "-q") { 
    216                 self::$msgOutputLevel = PROJECT_MSG_WARN; 
     216                self::$msgOutputLevel = Project::MSG_WARN; 
    217217            } elseif ($arg == "-verbose") { 
    218218                $this->printVersion(); 
    219                 self::$msgOutputLevel = PROJECT_MSG_VERBOSE; 
     219                self::$msgOutputLevel = Project::MSG_VERBOSE; 
    220220            } elseif ($arg == "-debug") { 
    221221                $this->printVersion(); 
    222                 self::$msgOutputLevel = PROJECT_MSG_DEBUG; 
     222                self::$msgOutputLevel = Project::MSG_DEBUG; 
    223223            } elseif ($arg == "-logfile") { 
    224224                try { // try to set logfile 
     
    332332        $filename = $file->getParent(); 
    333333 
    334         if ($filename !== null && self::$msgOutputLevel >= PROJECT_MSG_VERBOSE) { 
     334        if ($filename !== null && self::$msgOutputLevel >= Project::MSG_VERBOSE) { 
    335335            print("Searching in $filename\n"); 
    336336        } 
     
    354354     */ 
    355355    function _findBuildFile($start, $suffix) { 
    356         if (self::$msgOutputLevel >= PROJECT_MSG_INFO) { 
     356        if (self::$msgOutputLevel >= Project::MSG_INFO) { 
    357357            print("Searching for $suffix ...\n"); 
    358358        } 
     
    571571         * If there is no currently-configured Project, then this will do nothing. 
    572572         * @param string $message 
    573          * @param int $priority PROJECT_MSG_INFO, etc. 
     573         * @param int $priority Project::MSG_INFO, etc. 
    574574         */ 
    575         public static function log($message, $priority = PROJECT_MSG_INFO) { 
     575        public static function log($message, $priority = Project::MSG_INFO) { 
    576576                $p = self::getCurrentProject(); 
    577577                if ($p) { 
     
    603603                                        case E_NOTICE: 
    604604                        case E_USER_NOTICE: 
    605                                                 self::log($message, PROJECT_MSG_VERBOSE); 
     605                                                self::log($message, Project::MSG_VERBOSE); 
    606606                            break; 
    607607                                        case E_WARNING: 
    608608                        case E_USER_WARNING: 
    609                                                 self::log($message, PROJECT_MSG_WARN); 
     609                                                self::log($message, Project::MSG_WARN); 
    610610                            break; 
    611611                        case E_ERROR: 
    612612                                        case E_USER_ERROR: 
    613613                        default: 
    614                                                 self::log($message, PROJECT_MSG_ERR); 
     614                                                self::log($message, Project::MSG_ERR); 
    615615         
    616616                    } // switch 
     
    870870            $new_parts = array_diff($add_parts, $curr_parts); 
    871871            if ($new_parts) { 
    872                 if (self::getMsgOutputLevel() === PROJECT_MSG_DEBUG) { 
     872                if (self::getMsgOutputLevel() === Project::MSG_DEBUG) { 
    873873                    print("Phing::import() prepending new include_path components: " . implode(PATH_SEPARATOR, $new_parts) . "\n"); 
    874874                } 
     
    881881        if ($ret === false) { 
    882882            $e = new BuildException("Error importing $path"); 
    883             if (self::getMsgOutputLevel() === PROJECT_MSG_DEBUG) { 
     883            if (self::getMsgOutputLevel() === Project::MSG_DEBUG) { 
    884884                // We can't log this because listeners belong 
    885885                // to projects.  We'll just print it -- of course 
  • trunk/classes/phing/Project.php

    r130 r144  
    2020 */ 
    2121 
    22 define('PROJECT_MSG_DEBUG', 4); 
    23 define('PROJECT_MSG_VERBOSE', 3); 
    24 define('PROJECT_MSG_INFO', 2); 
    25 define('PROJECT_MSG_WARN', 1); 
    26 define('PROJECT_MSG_ERR', 0); 
     22// DEPRECATED logging constants 
     23define('PROJECT_MSG_DEBUG', Project::MSG_DEBUG); 
     24define('PROJECT_MSG_VERBOSE', Project::MSG_VERBOSE); 
     25define('PROJECT_MSG_INFO', Project::MSG_INFO); 
     26define('PROJECT_MSG_WARN', Project::MSG_WARN); 
     27define('PROJECT_MSG_ERR', Project::MSG_ERR); 
    2728 
    2829include_once 'phing/system/io/PhingFile.php'; 
     
    4647class Project { 
    4748 
     49        // Logging level constants. 
     50        const MSG_DEBUG = 4; 
     51        const MSG_VERBOSE = 3; 
     52        const MSG_INFO = 2; 
     53        const MSG_WARN = 1; 
     54        const MSG_ERR = 0; 
     55         
    4856    /** contains the targets */ 
    4957    private $targets         = array(); 
     
    195203        // command line properties take precedence 
    196204        if (isset($this->userProperties[$name])) { 
    197             $this->log("Override ignored for user property " . $name, PROJECT_MSG_VERBOSE); 
     205            $this->log("Override ignored for user property " . $name, Project::MSG_VERBOSE); 
    198206            return; 
    199207        } 
    200208 
    201209        if (isset($this->properties[$name])) { 
    202             $this->log("Overriding previous definition of property " . $name, PROJECT_MSG_VERBOSE); 
    203         } 
    204  
    205         $this->log("Setting project property: " . $name . " -> " . $value, PROJECT_MSG_DEBUG); 
     210            $this->log("Overriding previous definition of property " . $name, Project::MSG_VERBOSE); 
     211        } 
     212 
     213        $this->log("Setting project property: " . $name . " -> " . $value, Project::MSG_DEBUG); 
    206214        $this->properties[$name] = $value; 
    207215    } 
     
    220228    public function setNewProperty($name, $value) { 
    221229        if (isset($this->properties[$name])) { 
    222             $this->log("Override ignored for property " . $name, PROJECT_MSG_DEBUG); 
     230            $this->log("Override ignored for property " . $name, Project::MSG_DEBUG); 
    223231            return; 
    224232        } 
    225         $this->log("Setting project property: " . $name . " -> " . $value, PROJECT_MSG_DEBUG); 
     233        $this->log("Setting project property: " . $name . " -> " . $value, Project::MSG_DEBUG); 
    226234        $this->properties[$name] = $value; 
    227235    } 
     
    237245     */ 
    238246    public function setUserProperty($name, $value) { 
    239         $this->log("Setting ro project property: " . $name . " -> " . $value, PROJECT_MSG_DEBUG); 
     247        $this->log("Setting ro project property: " . $name . " -> " . $value, Project::MSG_DEBUG); 
    240248        $this->userProperties[$name] = $value; 
    241249        $this->properties[$name] = $value; 
     
    269277    private function setPropertyInternal($name, $value) { 
    270278        if (isset($this->userProperties[$name])) { 
    271                         $this->log("Override ignored for user property " . $name, PROJECT_MSG_VERBOSE); 
     279                        $this->log("Override ignored for user property " . $name, Project::MSG_VERBOSE); 
    272280            return; 
    273281        } 
     
    449457        $this->basedir = $dir; 
    450458        $this->setPropertyInternal("project.basedir", $this->basedir->getAbsolutePath()); 
    451         $this->log("Project base dir set to: " . $this->basedir->getPath(), PROJECT_MSG_VERBOSE); 
     459        $this->log("Project base dir set to: " . $this->basedir->getPath(), Project::MSG_VERBOSE); 
    452460         
    453461        // [HL] added this so that ./ files resolve correctly.  This may be a mistake ... or may be in wrong place.                 
     
    509517        $class = $class; 
    510518        if ($class === "") { 
    511             $this->log("Task $name has no class defined.", PROJECT_MSG_ERR); 
     519            $this->log("Task $name has no class defined.", Project::MSG_ERR); 
    512520        }  elseif (!isset($this->taskdefs[$name])) { 
    513521            Phing::import($class, $classpath); 
    514522            $this->taskdefs[$name] = $class; 
    515             $this->log("  +Task definiton: $name ($class)", PROJECT_MSG_DEBUG); 
     523            $this->log("  +Task definiton: $name ($class)", Project::MSG_DEBUG); 
    516524        } else { 
    517             $this->log("Task $name ($class) already registerd, skipping", PROJECT_MSG_VERBOSE); 
     525            $this->log("Task $name ($class) already registerd, skipping", Project::MSG_VERBOSE); 
    518526        } 
    519527    } 
     
    533541            Phing::import($typeClass, $classpath); 
    534542            $this->typedefs[$typeName] = $typeClass; 
    535             $this->log("  +User datatype: $typeName ($typeClass)", PROJECT_MSG_DEBUG); 
     543            $this->log("  +User datatype: $typeName ($typeClass)", Project::MSG_DEBUG); 
    536544        } else { 
    537             $this->log("Type $name ($class) already registerd, skipping", PROJECT_MSG_VERBOSE); 
     545            $this->log("Type $name ($class) already registerd, skipping", Project::MSG_VERBOSE); 
    538546        } 
    539547    } 
     
    552560 
    553561    function addOrReplaceTarget($targetName, &$target) { 
    554         $this->log("  +Target: $targetName", PROJECT_MSG_DEBUG); 
     562        $this->log("  +Target: $targetName", Project::MSG_DEBUG); 
    555563        $target->setProject($this); 
    556564        $this->targets[$targetName] = $target; 
     
    602610                $task = $o; 
    603611            } else { 
    604                 $this->log ("  (Using TaskAdapter for: $taskType)", PROJECT_MSG_DEBUG); 
     612                $this->log ("  (Using TaskAdapter for: $taskType)", Project::MSG_DEBUG); 
    605613                // not a real task, try adapter 
    606614                $taskA = new TaskAdapter(); 
     
    612620            // set default value, can be changed by the user 
    613621            $task->setTaskName($taskType); 
    614             $this->log ("  +Task: " . $taskType, PROJECT_MSG_DEBUG); 
     622            $this->log ("  +Task: " . $taskType, Project::MSG_DEBUG); 
    615623        } catch (Exception $t) { 
    616624            throw new BuildException("Could not create task of type: " . $taskType, $t); 
     
    649657             
    650658            $type = new $cls(); 
    651             $this->log("  +Type: $typeName", PROJECT_MSG_DEBUG); 
     659            $this->log("  +Type: $typeName", Project::MSG_DEBUG); 
    652660            if (!($type instanceof DataType)) { 
    653661                throw new Exception("$class is not an instance of phing.types.DataType"); 
     
    701709                $curTarget->performTasks(); 
    702710            } catch (BuildException $exc) { 
    703                 $this->log("Execution of target \"".$curTarget->getName()."\" failed for the following reason: ".$exc->getMessage(), PROJECT_MSG_ERR); 
     711                $this->log("Execution of target \"".$curTarget->getName()."\" failed for the following reason: ".$exc->getMessage(), Project::MSG_ERR); 
    704712                throw $exc; 
    705713            } 
     
    746754            $retHuman .= $ret[$i]->toString()." "; 
    747755        } 
    748         $this->log("Build sequence for target '$root' is: $retHuman", PROJECT_MSG_VERBOSE); 
     756        $this->log("Build sequence for target '$root' is: $retHuman", Project::MSG_VERBOSE); 
    749757 
    750758        $keys = array_keys($targets); 
     
    768776            $retHuman .= $ret[$i]->toString()." "; 
    769777        } 
    770         $this->log("Complete build sequence is: $retHuman", PROJECT_MSG_VERBOSE); 
     778        $this->log("Complete build sequence is: $retHuman", Project::MSG_VERBOSE); 
    771779 
    772780        return $ret; 
     
    854862    function addReference($name, $object) { 
    855863        if (isset($this->references[$name])) { 
    856             $this->log("Overriding previous definition of reference to $name", PROJECT_MSG_WARN); 
    857         } 
    858         $this->log("Adding reference: $name -> ".get_class($object), PROJECT_MSG_DEBUG); 
     864            $this->log("Overriding previous definition of reference to $name", Project::MSG_WARN); 
     865        } 
     866        $this->log("Adding reference: $name -> ".get_class($object), Project::MSG_DEBUG); 
    859867        $this->references[$name] = $object; 
    860868    } 
     
    884892     * Abstracting and simplifyling Logger calls for project messages 
    885893     */ 
    886     function log($msg, $level = PROJECT_MSG_INFO) { 
     894    function log($msg, $level = Project::MSG_INFO) { 
    887895        $this->logObject($this, $msg, $level); 
    888896    } 
  • trunk/classes/phing/ProjectComponent.php

    r123 r144  
    6565     *  @param  integer  The message's priority at this message should have 
    6666     */ 
    67     public function log($msg, $level = PROJECT_MSG_INFO) { 
     67    public function log($msg, $level = Project::MSG_INFO) { 
    6868        if ($this->project !== null) { 
    6969            $this->project->log($msg, $level); 
  • trunk/classes/phing/Target.php

    r123 r144  
    245245            } 
    246246        } elseif (!$this->testIfCondition()) { 
    247             $this->project->log("Skipped target '".$this->name."' because property '".$this->ifCondition."' not set.", PROJECT_MSG_VERBOSE); 
     247            $this->project->log("Skipped target '".$this->name."' because property '".$this->ifCondition."' not set.", Project::MSG_VERBOSE); 
    248248        } else { 
    249             $this->project->log("Skipped target '".$this->name."' because property '".$this->unlessCondition."' set.", PROJECT_MSG_VERBOSE); 
     249            $this->project->log("Skipped target '".$this->name."' because property '".$this->unlessCondition."' set.", Project::MSG_VERBOSE); 
    250250        } 
    251251    } 
  • trunk/classes/phing/Task.php

    r123 r144  
    137137     *  @see BuildListener 
    138138     */ 
    139     function log($msg, $level = PROJECT_MSG_INFO) { 
     139    function log($msg, $level = Project::MSG_INFO) { 
    140140        $this->project->logObject($this, $msg, $level); 
    141141    } 
  • trunk/classes/phing/TaskAdapter.php

    r123 r144  
    4646                $this->proxy->setProject($this->project); 
    4747            } catch (Exception $ex) { 
    48                 $this->log("Error setting project in " . get_class($this->proxy) . PROJECT_MSG_ERR); 
     48                $this->log("Error setting project in " . get_class($this->proxy) . Project::MSG_ERR); 
    4949                throw new BuildException($ex); 
    5050            } 
     
    5757                $this->proxy->main($this->project); 
    5858            } catch (Exception $ex) { 
    59                 $this->log("Error in " . get_class($this->proxy), PROJECT_MSG_ERR); 
     59                $this->log("Error in " . get_class($this->proxy), Project::MSG_ERR); 
    6060                throw new BuildException($ex->getMessage()); 
    6161            } 
  • trunk/classes/phing/filters/BaseFilterReader.php

    r123 r144  
    148148     * @param int $level Priority level. 
    149149     */ 
    150     function log($msg, $level = PROJECT_MSG_INFO) { 
     150    function log($msg, $level = Project::MSG_INFO) { 
    151151        if ($this->project !== null) { 
    152152            $this->project->log("[filter:".get_class($this)."] ".$msg, $level);     
  • trunk/classes/phing/filters/ReplaceRegexp.php

    r123 r144  
    9898            try { 
    9999                $buffer = $regexp->replace($buffer); 
    100                 $this->log("Performing regexp replace: /".$regexp->getPattern()."/".$regexp->getReplace()."/g".($regexp->getIgnoreCase() ? 'i' : ''), PROJECT_MSG_VERBOSE); 
     100                $this->log("Performing regexp replace: /".$regexp->getPattern()."/".$regexp->getReplace()."/g".($regexp->getIgnoreCase() ? 'i' : ''), Project::MSG_VERBOSE); 
    101101            } catch (Exception $e) { 
    102102                // perhaps mismatch in params (e.g. no replace or pattern specified) 
    103                 $this->log("Error performing regexp replace: " . $e->getMessage(), PROJECT_MSG_WARN); 
     103                $this->log("Error performing regexp replace: " . $e->getMessage(), Project::MSG_WARN); 
    104104            } 
    105105        } 
  • trunk/classes/phing/filters/TranslateGettext.php

    r123 r144  
    141141        $this->storedLocale = getenv("LANG"); 
    142142         
    143         $this->log("Setting locale to " . $this->locale, PROJECT_MSG_DEBUG); 
     143        $this->log("Setting locale to " . $this->locale, Project::MSG_DEBUG); 
    144144        putenv("LANG=".$this->locale); 
    145145        $ret = setlocale(LC_ALL, $this->locale); 
     
    151151        }         
    152152         
    153         $this->log("Binding domain '".$this->domain."' to "  . $this->dir, PROJECT_MSG_DEBUG); 
     153        $this->log("Binding domain '".$this->domain."' to "  . $this->dir, Project::MSG_DEBUG); 
    154154        bindtextdomain($this->domain, $this->dir->getAbsolutePath()); 
    155155        textdomain($this->domain);         
     
    182182        $msgid = $matches[2]; 
    183183        $translated = gettext($msgid); 
    184         $this->log("Translating \"$msgid\" => \"$translated\"", PROJECT_MSG_DEBUG); 
     184        $this->log("Translating \"$msgid\" => \"$translated\"", Project::MSG_DEBUG); 
    185185        return $charbefore . '"' . $translated . '"'; 
    186186    } 
     
    232232        $matches = array(); 
    233233        if (preg_match('/([^\w]|^)(gettext\([^\)]+\))/', $buffer, $matches)) { 
    234             $this->log("Unable to perform translation on: " . $matches[2], PROJECT_MSG_WARN); 
     234            $this->log("Unable to perform translation on: " . $matches[2], Project::MSG_WARN); 
    235235        } 
    236236                 
  • trunk/classes/phing/filters/XincludeFilter.php

    r139 r144  
    7373 
    7474        if (empty($_xml)) { 
    75             $this->log("XML file is empty!", PROJECT_MSG_WARN); 
     75            $this->log("XML file is empty!", Project::MSG_WARN); 
    7676            return '';  
    7777        } 
    7878        
    79         $this->log("Transforming XML " . $this->in->getResource() . " using Xinclude ", PROJECT_MSG_VERBOSE); 
     79        $this->log("Transforming XML " . $this->in->getResource() . " using Xinclude ", Project::MSG_VERBOSE); 
    8080         
    8181        $out = ''; 
  • trunk/classes/phing/filters/XsltFilter.php

    r123 r144  
    151151 
    152152        if(empty($_xml)) { 
    153             $this->log("XML file is empty!", PROJECT_MSG_WARN); 
     153            $this->log("XML file is empty!", Project::MSG_WARN); 
    154154            return ''; // return empty string, don't attempt to apply XSLT 
    155155        } 
     
    160160        $xslFr->readInto($_xsl); 
    161161         
    162         $this->log("Tranforming XML " . $this->in->getResource() . " using style " . $this->xslFile->getPath(), PROJECT_MSG_VERBOSE); 
     162        $this->log("Tranforming XML " . $this->in->getResource() . " using style " . $this->xslFile->getPath(), Project::MSG_VERBOSE); 
    163163         
    164164        $out = ''; 
     
    202202        // we're only supporting direct XSL params right now 
    203203        foreach($this->xsltParams as $param) { 
    204             $this->log("Setting XSLT param: " . $param->getName() . "=>" . $param->getExpression(), PROJECT_MSG_DEBUG); 
     204            $this->log("Setting XSLT param: " . $param->getName() . "=>" . $param->getExpression(), Project::MSG_DEBUG); 
    205205            $processor->setParameter(null, $param->getName(), $param->getExpression()); 
    206206        } 
  • trunk/classes/phing/listener/AnsiColorLogger.php

    r123 r144  
    210210             
    211211            switch ($priority) { 
    212                 case PROJECT_MSG_ERR: 
     212                case Project::MSG_ERR: 
    213213                    $message = $this->errColor . $message . self::END_COLOR; 
    214214                    break; 
    215                 case PROJECT_MSG_WARN: 
     215                case Project::MSG_WARN: 
    216216                    $message = $this->warnColor . $message . self::END_COLOR;                     
    217217                    break; 
    218                 case PROJECT_MSG_INFO: 
     218                case Project::MSG_INFO: 
    219219                    $message = $this->infoColor . $message . self::END_COLOR; 
    220220                    break; 
    221                 case PROJECT_MSG_VERBOSE: 
     221                case Project::MSG_VERBOSE: 
    222222                    $message = $this->verboseColor . $message . self::END_COLOR; 
    223223                    break; 
    224                 case PROJECT_MSG_DEBUG: 
     224                case Project::MSG_DEBUG: 
    225225                    $message = $this->debugColor . $message . self::END_COLOR; 
    226226                    break; 
  • trunk/classes/phing/listener/DefaultLogger.php

    r143 r144  
    4545    /** 
    4646     *  The message output level that should be used. The default is 
    47      *  <code>PROJECT_MSG_VERBOSE</code>. 
     47     *  <code>Project::MSG_VERBOSE</code>. 
    4848     *  @var int 
    4949     */ 
    50     protected $msgOutputLevel = PROJECT_MSG_ERR; 
     50    protected $msgOutputLevel = Project::MSG_ERR; 
    5151 
    5252    /** 
     
    8080     * 
    8181     *  <ul> 
    82      *    <li>PROJECT_MSG_ERR</li> 
    83      *    <li>PROJECT_MSG_WARN</li> 
    84      *    <li>PROJECT_MSG_INFO</li> 
    85      *    <li>PROJECT_MSG_VERBOSE</li> 
    86      *    <li>PROJECT_MSG_DEBUG</li> 
     82     *    <li>Project::MSG_ERR</li> 
     83     *    <li>Project::MSG_WARN</li> 
     84     *    <li>Project::MSG_INFO</li> 
     85     *    <li>Project::MSG_VERBOSE</li> 
     86     *    <li>Project::MSG_DEBUG</li> 
    8787     *  </ul> 
    8888     * 
    89      *  The default message level for DefaultLogger is PROJECT_MSG_ERR. 
     89     *  The default message level for DefaultLogger is Project::MSG_ERR. 
    9090     * 
    9191     *  @param  integer  the logging level for the logger. 
     
    106106    function buildStarted(BuildEvent $event) { 
    107107        $this->startTime = Phing::currentTimeMillis(); 
    108         if ($this->msgOutputLevel >= PROJECT_MSG_INFO) { 
    109             $this->printMessage("Buildfile: ".$event->getProject()->getProperty("phing.file"), PROJECT_MSG_INFO); 
     108        if ($this->msgOutputLevel >= Project::MSG_INFO) { 
     109            $this->printMessage("Buildfile: ".$event->getProject()->getProperty("phing.file"), Project::MSG_INFO); 
    110110        } 
    111111    } 
     
    125125        } else { 
    126126            print($this->lSep . "BUILD FAILED" . $this->lSep); 
    127             if (PROJECT_MSG_VERBOSE <= $this->msgOutputLevel || !($error instanceof BuildException)) { 
     127            if (Project::MSG_VERBOSE <= $this->msgOutputLevel || !($error instanceof BuildException)) { 
    128128                print($error->__toString().$this->lSep); 
    129129            } else { 
     
    142142     */ 
    143143    function targetStarted(BuildEvent $event) { 
    144         if (PROJECT_MSG_INFO <= $this->msgOutputLevel) { 
     144        if (Project::MSG_INFO <= $this->msgOutputLevel) { 
    145145            print($this->lSep . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ':' . $this->lSep); 
    146146        } 
  • trunk/classes/phing/listener/PearLogger.php

    r143 r144  
    5353    /** 
    5454     *  The message output level that should be used. The default is 
    55      *  <code>PROJECT_MSG_VERBOSE</code>. 
     55     *  <code>Project::MSG_VERBOSE</code>. 
    5656     *  @var int 
    5757     */ 
    58     protected $msgOutputLevel = PROJECT_MSG_DEBUG; 
     58    protected $msgOutputLevel = Project::MSG_DEBUG; 
    5959 
    6060    /** 
     
    6565     
    6666    /** 
    67      * Maps Phing PROJECT_MSG_* constants to PEAR_LOG_* constants. 
     67     * Maps Phing Project::MSG_* constants to PEAR_LOG_* constants. 
    6868     * @var array 
    6969     */ 
    70     protected static $levelMap = array( PROJECT_MSG_DEBUG => PEAR_LOG_DEBUG, 
    71                                         PROJECT_MSG_INFO => PEAR_LOG_INFO, 
    72                                         PROJECT_MSG_VERBOSE => PEAR_LOG_NOTICE, 
    73                                         PROJECT_MSG_WARN => PEAR_LOG_WARNING, 
    74                                         PROJECT_MSG_ERR => PEAR_LOG_ERR 
     70    protected static $levelMap = array( Project::MSG_DEBUG => PEAR_LOG_DEBUG, 
     71                                        Project::MSG_INFO => PEAR_LOG_INFO, 
     72                                        Project::MSG_VERBOSE => PEAR_LOG_NOTICE, 
     73                                        Project::MSG_WARN => PEAR_LOG_WARNING, 
     74                                        Project::MSG_ERR => PEAR_LOG_ERR 
    7575                                       ); 
    7676    /** 
     
    129129     * 
    130130     *  <ul> 
    131      *    <li>PROJECT_MSG_ERR</li> 
    132      *    <li>PROJECT_MSG_WARN</li> 
    133      *    <li>PROJECT_MSG_INFO</li> 
    134      *    <li>PROJECT_MSG_VERBOSE</li> 
    135      *    <li>PROJECT_MSG_DEBUG</li> 
     131     *    <li>Project::MSG_ERR</li> 
     132     *    <li>Project::MSG_WARN</li> 
     133     *    <li>Project::MSG_INFO</li> 
     134     *    <li>Project::MSG_VERBOSE</li> 
     135     *    <li>Project::MSG_DEBUG</li> 
    136136     *  </ul> 
    137137     * 
    138      *  The default message level for DefaultLogger is PROJECT_MSG_ERR. 
     138     *  The default message level for DefaultLogger is Project::MSG_ERR. 
    139139     * 
    140140     *  @param  integer  the logging level for the logger. 
  • trunk/classes/phing/listener/XmlLogger.php

    r143 r144  
    6464                private $buildElement = NULL; 
    6565                 
    66                 private $msgOutputLevel = PROJECT_MSG_DEBUG; 
     66                private $msgOutputLevel = Project::MSG_DEBUG; 
    6767                 
    6868                /** 
     
    229229                        switch ($priority) 
    230230                        { 
    231                                 case PROJECT_MSG_ERR:  
     231                                case Project::MSG_ERR:  
    232232                                        $name = "error";  
    233233                                        break; 
    234234                                         
    235                                 case PROJECT_MSG_WARN: 
     235                                case Project::MSG_WARN: 
    236236                                        $name = "warn"; 
    237237                                        break; 
    238238                                 
    239                                 case PROJECT_MSG_INFO: 
     239                                case Project::MSG_INFO: 
    240240                                        $name = "info"; 
    241241                                        break; 
  • trunk/classes/phing/parser/ProjectConfigurator.php

    r143 r144  
    8989            $parser->parserSetOption(XML_OPTION_CASE_FOLDING,0); 
    9090            $parser->setHandler(new RootHandler($parser, $this));