插入函数概念 接收一个callback,然后外面函数,接一个对象,和一个next,外面都执行完了,继续执行下一个函数,相当于一个链状体,插入了一个函数的概念 | log4js 输出 等于 console.info

插入函数概念 接收一个callback,然后外面函数,接一个对象,和一个next,外面都执行完了,继续执行下一个函数,相当于一个链状体,插入了一个函数的概念

app.use(function (ctx, next) {
  ctx.log.info('Got a request from %s for %s', ctx.request.ip, ctx.path);
  return next();
});

Koa2 学习文档 (不错我觉得)

https://blog.csdn.net/pingsoli/article/details/76584093

log4js 输出 等于 console.info

原文地址:https://www.cnblogs.com/pengchenggang/p/10844219.html