Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

日志输出被格式化两遍 #62

Open
ghostoy opened this issue Jul 18, 2022 · 0 comments · May be fixed by #63
Open

日志输出被格式化两遍 #62

ghostoy opened this issue Jul 18, 2022 · 0 comments · May be fixed by #63

Comments

@ghostoy
Copy link

ghostoy commented Jul 18, 2022

  • Node Version: 18.5.0
  • Midway Version(Decorator/Core): 3.3.6
  • Component Name/Version: @midwayjs/logger@2.16.3
  • Platform:
  • Mini Showcase Repository:
logger.info('%s', '%Y-%m-%d')
// 应该输出
// %Y-%m-%d
// 实际输出
// %Y-%m-NaN

在@midwayjs/logger中使用util.format%s部分格式化一遍,然后到了winston里又被splat格式化了一遍,导致日志中输出错误。

ghostoy added a commit to ghostoy/logger that referenced this issue Jul 18, 2022
`splat` of `winston` takes care of message formatting. No need to format
the message on `@midwayjs/logger` side.

Fixed midwayjs#62
@ghostoy ghostoy linked a pull request Jul 18, 2022 that will close this issue
ghostoy added a commit to ghostoy/logger that referenced this issue Jul 28, 2022
`splat` of `winston` takes care of message formatting. No need to format
the message on `@midwayjs/logger` side.

Fixed midwayjs#62
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant