-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding more verbosity control variables. (#530)
* Adding more verbosity control variables. * Documenting vars.
- Loading branch information
Showing
14 changed files
with
157 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
* A phing task to loop through properties. | ||
*/ | ||
require_once 'phing/Task.php'; | ||
use Symfony\Component\Yaml\Yaml; | ||
|
||
class VerbosityTask extends Task { | ||
|
||
/** | ||
* Path the Drush executable. | ||
*/ | ||
public function setLevel($str) { | ||
$this->level = $str; | ||
} | ||
|
||
|
||
/** | ||
* The main entry point method. | ||
* | ||
* @return bool | ||
* @throws BuildException | ||
*/ | ||
public function main() { | ||
|
||
$map = [ | ||
'debug' => Project::MSG_DEBUG, | ||
'verbose' => Project::MSG_VERBOSE, | ||
'info' => Project::MSG_INFO, | ||
'warn' => Project::MSG_WARN, | ||
'error' => Project::MSG_ERR, | ||
]; | ||
|
||
if (is_numeric($this->level)) { | ||
$this->setLoggerLevel($this->level); | ||
} | ||
elseif (array_key_exists($this->level, $map)) { | ||
$this->setLoggerLevel($map[$this->level]); | ||
} | ||
else { | ||
$this->log("blt.level '{$this->level}' is invalid. Acceptable values are " . implode(', ', array_keys($map)), Project::MSG_ERR); | ||
} | ||
} | ||
public function setLoggerLevel($level) { | ||
$listeners = $this->getProject()->getBuildListeners(); | ||
foreach ($listeners as $listener) { | ||
$listener->setMessageOutputLevel($level); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.