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

style: format cri logs #2147

Merged
merged 1 commit into from
Aug 23, 2018

Conversation

starnop
Copy link
Contributor

@starnop starnop commented Aug 23, 2018

Signed-off-by: Starnop [email protected]

Ⅰ. Describe what this PR did

Now,we should try to use failed to do something and success to do something when constructing error or log.

Ⅱ. Does this pull request fix one issue?

None.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@@ -33,7 +33,7 @@ func RunCriService(daemonconfig *config.Config, containerMgr mgr.ContainerMgr, i
err = runv1alpha2(daemonconfig, containerMgr, imageMgr, volumeMgr, readyCh)
default:
readyCh <- false
err = fmt.Errorf("invalid CRI version,failed to start CRI service")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add the specific invalid version number in the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@allencloud
Copy link
Collaborator

I think there should be some rule to guide us:

  • which scenario to use log level Error;
  • and which scenario to use log level Warn;

In the future we will use container-debugger to judge error log, if one day, we will generate more than 1000+ messages, I do not think the debugger-tool would take effect.

So, we need to add some guidance for us. @starnop

Also cc @fuweid to guide us to have it.

Signed-off-by: Starnop <[email protected]>
@codecov-io
Copy link

codecov-io commented Aug 23, 2018

Codecov Report

Merging #2147 into master will decrease coverage by 0.04%.
The diff coverage is 42.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2147      +/-   ##
==========================================
- Coverage   64.41%   64.37%   -0.05%     
==========================================
  Files         209      209              
  Lines       16662    16662              
==========================================
- Hits        10733    10726       -7     
- Misses       4603     4607       +4     
- Partials     1326     1329       +3
Flag Coverage Δ
#criv1alpha1test 32.93% <21.23%> (-0.06%) ⬇️
#criv1alpha2test 33.38% <21.23%> (-0.18%) ⬇️
#integrationtest 39.25% <0%> (-0.02%) ⬇️
#unittest 23.86% <0%> (ø) ⬆️
Impacted Files Coverage Δ
cri/criservice.go 64.7% <0%> (ø) ⬆️
cri/v1alpha2/cri_wrapper.go 52.08% <41.37%> (ø) ⬆️
cri/v1alpha1/cri_wrapper.go 55.8% <44.44%> (ø) ⬆️
ctrd/watch.go 72.72% <0%> (-7.58%) ⬇️
apis/server/utils.go 61.9% <0%> (-4.77%) ⬇️
cri/v1alpha2/cri.go 63.95% <0%> (-0.34%) ⬇️
daemon/mgr/container.go 56.71% <0%> (-0.21%) ⬇️
ctrd/image.go 78.94% <0%> (+1.75%) ⬆️

@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Aug 23, 2018
@allencloud allencloud merged commit 1aacf65 into AliyunContainerService:master Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/log LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants