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

docs(schedule): logging && args #2091

Merged
merged 2 commits into from
Feb 8, 2018
Merged

docs(schedule): logging && args #2091

merged 2 commits into from
Feb 8, 2018

Conversation

atian25
Copy link
Member

@atian25 atian25 commented Feb 7, 2018

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@atian25 atian25 requested a review from dead-horse February 7, 2018 04:08
@codecov-io
Copy link

codecov-io commented Feb 7, 2018

Codecov Report

Merging #2091 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2091   +/-   ##
=======================================
  Coverage   99.59%   99.59%           
=======================================
  Files          29       29           
  Lines         743      743           
=======================================
  Hits          740      740           
  Misses          3        3

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 03a8944...0b358ad. Read the comment docs.


执行日志会输出到 `${appInfo.root}/logs/egg-schedule.log`,你也可以通过 `config.customLogger.scheduleLogger` 来自定义。

在任务中也可以通过 `ctx.loggers.scheduleLogger.info()` 来记录日志。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有一个问题,这里 scheduleLogger.error 不会 redirect 到 common-error 了,我之前以为只是准备内部用的。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有的, corelogger 还打着

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

喔,手动打就有问题了

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好像 logger 现在不支持 2 边同时打,redirect 后就只在另一边了。
那我先干掉这段吧。

PS:可以考虑提供 app.Schedule 来给用户继承,里面可以有 this.logger

@dead-horse dead-horse merged commit 5621a85 into master Feb 8, 2018
@dead-horse dead-horse deleted the schedule branch February 8, 2018 02:45
popomore pushed a commit that referenced this pull request Feb 8, 2018
docs(schedule): logging && args (#2091)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants