mirror of
https://github.com/hauke68/Magallanes.git
synced 2025-09-13 20:50:18 +02:00
Merge pull request #153 from edpauto/verbose-option
Add verbose option to commands
This commit is contained in:
commit
d9e860a20c
@ -48,6 +48,12 @@ class Console
|
|||||||
*/
|
*/
|
||||||
private static $logEnabled = true;
|
private static $logEnabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables or disables verbose logging
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
private static $verboseLogEnabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String Buffer for the screen output
|
* String Buffer for the screen output
|
||||||
* @var string
|
* @var string
|
||||||
@ -107,6 +113,8 @@ class Console
|
|||||||
self::$logEnabled = $config->general('logging', false);
|
self::$logEnabled = $config->general('logging', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self::$verboseLogEnabled = self::isVerboseLoggingEnabled();
|
||||||
|
|
||||||
// Greetings
|
// Greetings
|
||||||
if ($showGreetings) {
|
if ($showGreetings) {
|
||||||
if (!self::$logEnabled) {
|
if (!self::$logEnabled) {
|
||||||
@ -173,15 +181,17 @@ class Console
|
|||||||
{
|
{
|
||||||
self::log(strip_tags($message));
|
self::log(strip_tags($message));
|
||||||
|
|
||||||
self::$screenBuffer .= str_repeat("\t", $tabs)
|
if (!self::$verboseLogEnabled) {
|
||||||
. strip_tags($message)
|
self::$screenBuffer .= str_repeat("\t", $tabs)
|
||||||
. str_repeat(PHP_EOL, $newLine);
|
. strip_tags($message)
|
||||||
|
. str_repeat(PHP_EOL, $newLine);
|
||||||
|
|
||||||
$output = str_repeat("\t", $tabs)
|
$output = str_repeat("\t", $tabs)
|
||||||
. Colors::color($message, self::$config)
|
. Colors::color($message, self::$config)
|
||||||
. str_repeat(PHP_EOL, $newLine);
|
. str_repeat(PHP_EOL, $newLine);
|
||||||
|
|
||||||
echo $output;
|
echo $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -227,6 +237,10 @@ class Console
|
|||||||
|
|
||||||
$message = date('Y-m-d H:i:s -- ') . $message;
|
$message = date('Y-m-d H:i:s -- ') . $message;
|
||||||
fwrite(self::$log, $message . PHP_EOL);
|
fwrite(self::$log, $message . PHP_EOL);
|
||||||
|
|
||||||
|
if (self::$verboseLogEnabled) {
|
||||||
|
echo $message . PHP_EOL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,4 +300,15 @@ class Console
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if verbose logging is enabled
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
protected static function isVerboseLoggingEnabled()
|
||||||
|
{
|
||||||
|
return self::$config->getParameter('verbose', false)
|
||||||
|
|| self::$config->general('verbose_logging')
|
||||||
|
|| self::$config->environmentConfig('verbose_logging', false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,11 @@ mage releases rollback --release=-3 to:production
|
|||||||
# Rollback to a specific Release on the Production environment
|
# Rollback to a specific Release on the Production environment
|
||||||
# mage releases rollback --release=20120101172148 to:production
|
# mage releases rollback --release=20120101172148 to:production
|
||||||
|
|
||||||
|
# Output logs by adding verbose option to ANY command
|
||||||
|
mage deploy to:production --verbose
|
||||||
|
|
||||||
### List of UPCOMING Commands ###
|
### List of UPCOMING Commands ###
|
||||||
# mage config add host s05.example.com to:[production]
|
# mage config add host s05.example.com to:[production]
|
||||||
# mage config git git://github.com/andres-montanez/Zend-Framework-Twig-example-app.git
|
# mage config git git://github.com/andres-montanez/Zend-Framework-Twig-example-app.git
|
||||||
# mage config svn svn://example.com/repo
|
# mage config svn svn://example.com/repo
|
||||||
# mage task:deployment/rsync to:production
|
# mage task:deployment/rsync to:production
|
||||||
|
@ -21,3 +21,4 @@ tasks:
|
|||||||
- privileges
|
- privileges
|
||||||
- sampleTask
|
- sampleTask
|
||||||
- sampleTaskRollbackAware
|
- sampleTaskRollbackAware
|
||||||
|
verbose_logging: true
|
||||||
|
@ -29,3 +29,4 @@ tasks:
|
|||||||
# - sampleTask
|
# - sampleTask
|
||||||
post-deploy:
|
post-deploy:
|
||||||
- sampleTask
|
- sampleTask
|
||||||
|
verbose_logging: false
|
||||||
|
@ -3,6 +3,7 @@ name: My fantastic App
|
|||||||
email: andresmontanez@gmail.com
|
email: andresmontanez@gmail.com
|
||||||
notifications: true
|
notifications: true
|
||||||
logging: true
|
logging: true
|
||||||
|
verbose_logging: false
|
||||||
scm:
|
scm:
|
||||||
type: git
|
type: git
|
||||||
url: git://github.com/andres-montanez/Zend-Framework-Twig-example-app.git
|
url: git://github.com/andres-montanez/Zend-Framework-Twig-example-app.git
|
||||||
|
Loading…
Reference in New Issue
Block a user