Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added attribute logoutput to property task #139

Merged
merged 1 commit into from

2 participants

@Dundee

Hi,
here is a little patch which adds possibility to set logging of loading property files as verbose instead of info.

Cheers

@mrook
Owner

@Dundee Sorry for not noticing this pull earlier. Can you rebase this against master and maybe include a snippet about the new attribute in the documentation? Many thanks.

@Dundee

@mrook Rebased and added some info to documentation. Tests for PHP 5.6 failed but it does not seem to be due to this change. Thanks

@mrook
Owner

Yeah the 5.6 tests do fail randomly. I've restarted that build and all seems well. I'll merge it later today after releasing 2.8.2. Thanks!

@mrook mrook merged commit 60bd2d6 into from
@Dundee

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2014
  1. @Dundee
This page is out of date. Refresh to see the latest.
View
13 classes/phing/tasks/system/PropertyTask.php
@@ -57,6 +57,9 @@ class PropertyTask extends Task {
*/
protected $filterChains = array();
+ /** Whether to log messages as INFO or VERBOSE */
+ protected $logOutput = true;
+
/**
* Sets a the name of current property component
*/
@@ -209,6 +212,14 @@ public function createFilterChain() {
return $this->filterChains[$num-1];
}
+ function setLogoutput($logOutput) {
+ $this->logOutput = (bool) $logOutput;
+ }
+
+ function getLogoutput() {
+ return $this->logOutput;
+ }
+
/**
* set the property in the project to the value.
* if the task was give a file or env attribute
@@ -320,7 +331,7 @@ protected function addProperty($name, $value) {
*/
protected function loadFile(PhingFile $file) {
$props = new Properties();
- $this->log("Loading ". $file->getAbsolutePath(), Project::MSG_INFO);
+ $this->log("Loading ". $file->getAbsolutePath(), $this->logOutput ? Project::MSG_INFO : Project::MSG_VERBOSE);
try { // try to load file
if ($file->exists()) {
$props->load($file);
View
8 docs/docbook5/en/source/appendixes/coretasks.xml
@@ -2584,6 +2584,14 @@
<entry>n/a</entry>
<entry>No</entry>
</row>
+ <row>
+ <entry><literal>logoutput</literal></entry>
+ <entry><literal role="type">Boolean</literal></entry>
+ <entry>Whether to log returned output as MSG_INFO instead of
+ MSG_VERBOSE.</entry>
+ <entry><literal>true</literal></entry>
+ <entry>No</entry>
+ </row>
</tbody>
</tgroup>
</table>
Something went wrong with that request. Please try again.