node.js - Winston 记录器分析器时间单位
问题描述
我正在使用温斯顿记录器分析。
我的问题是如何更改分析器的时间单位。
我的代码:
this.logger.profile(`some ${jobId}`);
// do the job ....
this.logger.profile(`some ${jobId}`);
在结果中我看到:
{ ...,"message": "some 1", "durationMs":2500 ... }
我的问题是如何(是否)可以将时间单位从 ms 配置为 seconds/minuets 等...
所以我会看到
{ ...,"message": "some 1", "durationSeconds: 2.5" ... }
解决方案
不幸的是,答案是否定的:winston 没有提供以 ms 以外的单位提供持续时间的选项,请参阅:
https://github.com/winstonjs/winston/blob/master/lib/winston/profiler.js#L47
推荐阅读
- reactjs - 在 Spring Boot jar 中包含 Node 模块
- python - Python - 使用 Python pandas 将 xml 转换为 csv
- laravel - 如何在laravel中添加对关系数据的查询
- r - 使用rvest下载图片时如何添加Referer?
- matlab - 离散差分方程组的 Simulink 模型
- ms-media-foundation - 29.97 的视频时间戳计算
- prolog - 我正在尝试为 fibbonaci 系列编写一个 prolog 程序。这段代码正在无限循环中。有人能告诉你错误是什么吗?
- python - django.db.utils.IntegrityError: NOT NULL 约束失败 - drf_writable_nested
- winapi - WinAPI with Rust: CreateWindowExW 在第二次使用相同的 WNDCLASSEXW 调用时失败
- sql - 基于条件的索引列