Skip to content

Commit

Permalink
Merge branch 'fix325'
Browse files Browse the repository at this point in the history
  • Loading branch information
okuryu committed Mar 31, 2015
2 parents 0429a37 + 7134d92 commit 2530b7e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ var YUI = require('yui' + (debug ? '/debug' : '')).YUI,
fs = require('graceful-fs'),
metaPath = path.join(__dirname, '../', 'package.json');

function log (message, level) {
if (!message || !level || typeof console[level] !== 'function') {
return;
}

if (typeof message === 'object') {
message = JSON.stringify(message);
}

console[level]('%s: %s', level, message);
}

process.on('uncaughtException', function (msg) {
var meta = JSON.parse(fs.readFileSync(metaPath)),
Expand All @@ -44,6 +55,7 @@ process.on('uncaughtException', function (msg) {

inst.applyConfig({
debug: true,
logFn: log,
useColor: useColor
});

Expand Down Expand Up @@ -100,6 +112,7 @@ var Y = YUI({
attribute: true,
handlebars: true
},
logFn: log,
useSync: true
}).use('utils', 'docparser', 'yuidoc', 'doc-builder', 'docview', 'files', 'help', 'options', 'server', 'project');

Expand Down

0 comments on commit 2530b7e

Please sign in to comment.