diff --git a/core/server/config/index.js b/core/server/config/index.js index 832f500e7c..b5678809b1 100644 --- a/core/server/config/index.js +++ b/core/server/config/index.js @@ -1,11 +1,13 @@ var Nconf = require('nconf'), path = require('path'), - debug = require('debug')('ghost:config'), + _debug = require('debug'), + debug = _debug('ghost:config'), localUtils = require('./utils'), env = process.env.NODE_ENV || 'development', _private = {}; _private.loadNconf = function loadNconf(options) { + debug('config start'); options = options || {}; var baseConfigPath = options.baseConfigPath || __dirname, @@ -51,7 +53,13 @@ _private.loadNconf = function loadNconf(options) { */ nconf.set('env', env); - debug(nconf.get()); + // Wrap this in a check, because else nconf.get() is executed unnecessarily + // To output this, use DEBUG=ghost:*,ghost-config + if (_debug.enabled('ghost-config')) { + debug(nconf.get()); + } + + debug('config end'); return nconf; }; diff --git a/index.js b/index.js index aad6fb281d..458a90662f 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,21 @@ // # Ghost Startup // Orchestrates the startup of Ghost when run from command line. -var ghost = require('./core'), - debug = require('debug')('ghost:boot:index'), - express = require('express'), - logging = require('./core/server/logging'), - errors = require('./core/server/errors'), - utils = require('./core/server/utils'), - parentApp = express(); +console.time('Ghost boot'); + +var debug = require('debug')('ghost:boot:index'), + ghost, express, logging, errors, utils, parentApp; + +debug('First requires...'); + +ghost = require('./core'); + +debug('Required ghost'); + +express = require('express'); +logging = require('./core/server/logging'); +errors = require('./core/server/errors'); +utils = require('./core/server/utils'); +parentApp = express(); debug('Initialising Ghost'); ghost().then(function (ghostServer) { @@ -16,6 +25,7 @@ ghost().then(function (ghostServer) { debug('Starting Ghost'); // Let Ghost handle starting our server instance. return ghostServer.start(parentApp).then(function afterStart() { + console.timeEnd('Ghost boot'); // if IPC messaging is enabled, ensure ghost sends message to parent // process on successful start if (process.send) {