diff --git a/tools/meteor.js b/tools/meteor.js index 917221934a1..328a25a02bc 100644 --- a/tools/meteor.js +++ b/tools/meteor.js @@ -367,6 +367,8 @@ Fiber(function () { .describe('port', 'Port to listen on. NOTE: Also uses port N+1 and N+2.') .boolean('production') .describe('production', 'Run in production mode. Minify and bundle CSS and JS files.') + .boolean('raw-logs') + .describe('raw-logs', 'Run without parsing logs from stdout and stderr.') .describe('settings', 'Set optional data for Meteor.settings on the server') .describe('release', 'Specify the release of Meteor to use') .describe('program', 'The program in the app to run (Advanced)') @@ -394,6 +396,7 @@ Fiber(function () { maybePrintUserOverrideMessage(); runner.run(context, { port: argv.port, + rawLogs: argv['raw-logs'], minify: argv.production, once: argv.once, settingsFile: argv.settings, diff --git a/tools/run.js b/tools/run.js index 9382f9ce31e..8049b805262 100644 --- a/tools/run.js +++ b/tools/run.js @@ -303,16 +303,26 @@ var startServer = function (options) { return; } - var obj = Log.parse(line) || Log.objFromText(line); - console.log(Log.format(obj, { color:true })); - saveLog({stdout: Log.format(obj)}); + if (options.rawLogs) { + console.log(line); + saveLog({stdout: line}); + } else { + var obj = Log.parse(line) || Log.objFromText(line); + console.log(Log.format(obj, { color:true })); + saveLog({stdout: Log.format(obj)}); + } }); eachline(proc.stderr, 'utf8', function (line) { if (!line) return; - var obj = Log.objFromText(line, { level: 'warn', stderr: true }); - console.log(Log.format(obj, { color: true })); - saveLog({stderr: Log.format(obj)}); + if (options.rawLogs) { + console.error(line); + saveLog({stderr: line}); + } else { + var obj = Log.objFromText(line, { level: 'warn', stderr: true }); + console.log(Log.format(obj, { color: true })); + saveLog({stderr: Log.format(obj)}); + } }); proc.on('close', function (code, signal) { @@ -555,6 +565,7 @@ exports.run = function (context, options) { mongoUrl: mongoUrl, rootUrl: rootUrl, library: context.library, + rawLogs: options.rawLogs, onExit: function (code) { // on server exit Status.running = false;