Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CB-5680 Improve console logging when scripts invoked in child process
  • Loading branch information
bryanhiggins committed Dec 19, 2013
1 parent 9c07d20 commit 01600fbdc8f61b3f72c44e2f3cca545d8ed97b17
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 40 deletions.
@@ -73,30 +73,6 @@ _self = {

getDbPath : function () {
return getDefaultPathIfExists(DB);
},

warn: function () {
if (!this.getKeyStorePath()) {
console.error(
"WARNING: Cannot sign applications. Author.p12 file cannot be found at default location: " +
getDefaultPath("author.p12")
);
}

if (!this.getKeyStorePathBBID()) {

if (this.getCskPath() && this.getDbPath()) {
console.error(
"WARNING: BlackBerry ID tokens can now be used in place of your old signing keys.\n" +
"For more information log in at http://developer.blackberry.com and click on Code Signing"
);
} else {
console.error(
"WARNING: Cannot sign applications. bbidtoken.csk file cannot be found at default location: " +
getDefaultPath("bbidtoken.csk")
);
}
}
}
};

@@ -21,7 +21,7 @@ var path = require("path"),
command = require("commander"),
os = require("os"),
utils = require("./utils"),
signingUtils = require("./signing-utils"),
signingHelper = require("./signing-helper"),
bbProperties = utils.getProperties(),
bbwpArgv = [
process.argv[0],
@@ -65,7 +65,7 @@ try {
exit(ERROR_VALUE);
}

signingUtils.warn();
signingHelper.warn();

utils.series(
[
@@ -21,18 +21,20 @@ module.exports = {
},
info: function (msg) {
if (level === 'verbose') {
console.log("[INFO] " + msg);
console.log("[INFO] " + msg.replace(/info: /i, ""));
}
},
error: function (msg) {
console.error("[ERROR] " + msg);
console.error("[ERROR] " + msg.replace(/error: /i, ""));
},
warn: function (msg) {
if (level !== 'error') {
console.log("[WARN] " + msg);
console.log("[WARN] " + msg.replace(/warning: /i, ""));
}
},
log: function (msg) {
console.log("[BUILD] " + msg);
if (level === "verbose") {
console.log("[INFO] " + msg.replace(/info: /i, ""));
}
}
};
@@ -171,12 +171,14 @@ _self = {
var msg = data.toString().replace(/[\n\r]/g, '');

if (msg) {
if (msg.toLowerCase().indexOf("error: ") >= 0) {
logger.error(msg.substring(7));
} else if (msg.toLowerCase().indexOf("warn: ") >= 0) {
logger.warn(msg.substring(6));
} else if (msg.toLowerCase().indexOf("info: ") >= 0) {
logger.info(msg.substring(6));
if (msg.indexOf("[ERROR] ") >= 0) {
logger.error(msg.substring(8).trim());
} else if (msg.indexOf("[WARN] ") >= 0) {
logger.warn(msg.substring(7).trim());
} else if (msg.indexOf("[INFO] ") >= 0) {
logger.info(msg.substring(8).trim());
} else if (msg.indexOf("[BUILD] ") >= 0) {
logger.info(msg.substring(8).trim());
} else {
logger.info(msg);
}
@@ -21,7 +21,6 @@ var path = require("path"),
utils = require("./utils"),
options = require('commander'),
runUtils = require("./run-utils"),
signingUtils = require("./signing-utils"),
async = require("async");

function install(deployTarget, done) {
@@ -69,8 +68,6 @@ process.argv.forEach(function (argument, index, args) {

options.parse(process.argv);

signingUtils.warn();

utils.waterfall(
[
runUtils.getValidatedTarget.bind(this, options),
@@ -21,6 +21,7 @@ var path = require('path'),
utils = require("./utils"),
conf = require("./conf"),
pkgrUtils = require("./packager-utils"),
signingUtils = require("./signing-utils"),
logger = require("./logger"),
_self;

@@ -61,7 +62,28 @@ function execSigner(session, target, callback) {
}

_self = {
execSigner: execSigner
execSigner: execSigner,

warn: function () {
if (!signingUtils.getKeyStorePath()) {
logger.warn(
"Cannot sign applications. Author.p12 file cannot be found at default location: " +
signingUtils.getDefaultPath("author.p12")
);
}

if (!signingUtils.getKeyStorePathBBID()) {

if (signingUtils.getCskPath() && signingUtils.getDbPath()) {
logger.warn("Using legacy signing keys");
} else {
logger.warn(
"Cannot sign applications. bbidtoken.csk file cannot be found at default location: " +
signingUtils.getDefaultPath("bbidtoken.csk")
);
}
}
}
};

module.exports = _self;

0 comments on commit 01600fb

Please sign in to comment.