node.js - Morgan dev pretermined Format Broken
问题描述
So I am logging the logs using Morgan, The problem is that when I use the "dev" predefined mode, the logs seem broken they look something like this
[0mGET / [36m304[0m 45.776 ms - -[0m
[0mGET / [36m304[0m 15.317 ms - -[0m
However it should look something like this
GET / 304 0m 0m 15.317 ms -0
It seems to me that it is working fine but as dev mode have colours defined in it, and those colours are printing these weird symbols that my Linux(PopOS) Machine is unable to recognize,
my questions are how to fix it so that colour remains. Or just disable colours in dev mode to fix it
app.use(morgan(
mode: 'dev',
options: {
stream: accessLogStreamDevelopment,
}
));
解决方案
推荐阅读
- python - pandas read_csv - 从某一行开始每隔一行跳过
- amazon-web-services - DynamoDB Cloudformation 权限
- python - 使用 python 脚本为每个索引获取 aws es 快照时出现问题
- javascript - style.animationDuration 不适用于 javascript。尝试使用 javascript 添加 css 属性
- html - 如果没有直接文件链接,为什么 HTML5 视频搜索不起作用?
- firebase - 从 vuejs 中的云 Firestore 获取数据时如何显示微调器?
- c# - 身份服务器 4 和用户权限
- robotframework - 无法使用机器人框架处理弹出通知
- sql - 希望显示表 A 中与表 B 有多个关系的记录
- python - 将python虚拟环境设置为ubuntu用户?