This commit is contained in:
Igor Zinkovsky 2012-05-01 16:43:56 -07:00
Родитель b8e43bde23
Коммит 7b61c5e384
1 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -53,17 +53,16 @@ if (!process.env.AZURE_DEBUG || process.env.AZURE_DEBUG !== '1') {
}
cli.exit('error', null, 1);
});
});
}
///////////////////////////
// prepare output logger
// use cli output settings by default
log.cli();
log.format = function(options) {
log.format = function (options) {
var transport = log['default'].transports.console;
if (arguments.length === 0) {
return {
@ -80,13 +79,16 @@ log.format = function(options) {
transport.json = true;
transport.terse = true;
}
if (options.terse) {
log.padLevels = false;
transport.terse = true;
}
if (options.level) {
transport.level = options.level;
}
if (options.logo) {
log.format.logo = options.logo;
}
@ -98,6 +100,7 @@ log.json = function (level, data) {
data = level;
level = 'data';
}
if (log.format().json) {
log.log(level, typeof data, data);
} else {
@ -119,6 +122,7 @@ log.table = function (level, data, transform) {
data = level;
level = 'data';
}
if (log.format().json) {
log.log(level, 'table', data);
} else {
@ -292,6 +296,7 @@ function enableNestedCommands(command) {
var args = command.rawArgs.slice(0, 2);
var raw = command.normalize(command.rawArgs.slice(2));
var category = setupCommand(args, raw);
if (!command.categories[category]) {
log.error('\'' + category + '\' is not an azure command. See \'azure help\'.');
} else {