是否可以关闭风帆请求日志。就像我试图看不到粘贴在下面的例子。因为当我运行集成测试时,这些日志会妨碍报告。
<- PUT /api/v1/entrance/login (361ms 200)
| The requesting user agent has been successfully logged in.
|
| Under the covers, this stores the id of the logged-in user in the session as the `userId` key. The next time this user agent sends a request, assuming it includes a cookie (like a web browser), Sails will automatically make this user id available as req.session.userId in the corresponding action. (Also note that, thanks to the included "custom" hook, when a relevant request is received from a logged-in user, that user's entire record from the database will be fetched and exposed as `req.me`.)
|
°
<- GET /api/v1/user/me/overview/subscribe (26ms 200)
这是风帆钩。 https://www.npmjs.com/package/sails-hook-apianalytics
阅读文档,你可以编辑日志或禁用其中的一些,或者只是卸载钩子。
在项目的根目录上运行npm uninstall sails-hook-apianalytics
然后抬起风帆。
如果您检查sails.js documentation有关日志的信息,您可以根据需要更改日志级别。有几种方法可以实现这一点,但我更喜欢将日志级别放在env文件中,因为在生产中不需要某些日志,但在开发中有意义且易于执行此操作:
// config/env/production.js
module.exports = {
...
log: {
level: 'debug'
}
...
}