Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: definition fix for getLogger and getCoreLogger #783

Merged
merged 11 commits into from
Jan 2, 2021

Conversation

czy88840616
Copy link
Member

@czy88840616 czy88840616 commented Dec 31, 2020

处理几个问题

  • 1、给 app 和 framework 都增加 getCoreLogger 方法
  • 2、在本地开发的时候,ts-node 会出现扩展 egg 定义找不到的情况,原因是 ts-node 不认 tsconfig 中的 tsRoot,而编辑器和 tsc 则认识,导致只会在 run dev 的时候报错,但是如果提前 require 了对应的定义文件,则不会出现此问题,由于 midway 在文档里中推荐将定义放到 interface.ts 中,那么,在本地 dev 启动的时候,我们提前去 require 该文件即可。
  • 3、由于现在的日志是个大池子,其他框架也会和 egg 复用日志对象,在这种场景下,如果和 egg 复用(socket)Logger,那么池子里存在的,可能只有 fileLogger,不会输出控制台日志。
  • 4、新版本在使用 egg-layer 时,需要处理日志的问题,比如把 file transport 删除。 没有问题,因为 egg-layer 写到临时目录里去了

@gitpod-io
Copy link

gitpod-io bot commented Dec 31, 2020

@codecov-io
Copy link

codecov-io commented Dec 31, 2020

Codecov Report

Merging #783 (c82fc5c) into 2.x (705e8bc) will increase coverage by 0.01%.
The diff coverage is 89.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x     #783      +/-   ##
==========================================
+ Coverage   87.10%   87.11%   +0.01%     
==========================================
  Files         154      154              
  Lines        6350     6380      +30     
  Branches     1227     1235       +8     
==========================================
+ Hits         5531     5558      +27     
- Misses        790      793       +3     
  Partials       29       29              
Impacted Files Coverage Δ
packages-serverless/egg-layer/index.js 84.44% <ø> (ø)
packages/core/src/interface.ts 100.00% <ø> (ø)
packages/faas/src/framework.ts 89.04% <33.33%> (-1.24%) ⬇️
packages/mock/src/utils.ts 76.00% <85.71%> (-0.82%) ⬇️
packages/web/src/logger.ts 87.00% <92.30%> (+0.33%) ⬆️
packages/core/src/baseFramework.ts 94.16% <100.00%> (+1.56%) ⬆️
packages/logger/src/container.ts 100.00% <100.00%> (ø)
packages/logger/src/index.ts 94.11% <100.00%> (ø)
packages/web/src/utils.ts 81.81% <100.00%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 705e8bc...c82fc5c. Read the comment docs.

@czy88840616 czy88840616 merged commit 264b481 into 2.x Jan 2, 2021
@czy88840616 czy88840616 deleted the fix_get_logger_definition branch January 2, 2021 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants