Skip to content

Commit

Permalink
feat: show warning message with call stack (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored and dead-horse committed Mar 11, 2017
1 parent 4a89c3b commit d088283
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/agent.js
Expand Up @@ -61,7 +61,9 @@ class Agent extends EggApplication {
function wrapMethod(methodName, messenger, logger) {
const originMethod = messenger[methodName];
messenger[methodName] = function() {
logger.warn('agent can\'t call %s before server started', methodName);
const stack = new Error().stack.split('\n').slice(1).join('\n');
logger.warn('agent can\'t call %s before server started\n%s',
methodName, stack);
originMethod.apply(this, arguments);
};
messenger.once('egg-ready', () => {
Expand Down

0 comments on commit d088283

Please sign in to comment.