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 confusing log file example #103

Merged
merged 1 commit into from Oct 18, 2019

Conversation

@longkai
Copy link

longkai commented Oct 18, 2019

When people run the log_file example, no log file outputs because
the default value for logtostderr is true and nothing outputs except stderr.

This example confuses people and we should make log file works.

@k8s-ci-robot

This comment has been minimized.

Copy link

k8s-ci-robot commented Oct 18, 2019

Welcome @longkai!

It looks like this is your first PR to kubernetes/klog 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/klog has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot

This comment has been minimized.

Copy link

k8s-ci-robot commented Oct 18, 2019

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@longkai

This comment has been minimized.

Copy link
Author

longkai commented Oct 18, 2019

/assign @justinsb

"k8s.io/klog/v2"
)

func main() {
klog.InitFlags(nil)
// The default value for logtostderr is true and nothing outputs except stderr.

This comment has been minimized.

Copy link
@neolit123

neolit123 Oct 18, 2019

Member

please change the comment to:

// By default klog writes to stderr. Setting logtostderr to false makes klog write to a log file.

This comment has been minimized.

Copy link
@longkai

longkai Oct 18, 2019

Author

It has been changed.

Thank you for your review.

This comment has been minimized.

Copy link
@neolit123

neolit123 Oct 18, 2019

Member

please squash the 2 commits into 1.

This comment has been minimized.

Copy link
@longkai
@neolit123

This comment has been minimized.

Copy link
Member

neolit123 commented Oct 18, 2019

/priority backlog

@longkai longkai requested a review from neolit123 Oct 18, 2019
By default klog writes to stderr. Setting logtostderr to false makes klog
write to a log file.

Signed-off-by: longkai <im.longkai@gmail.com>
@longkai longkai force-pushed the longkai:example-log-file-fix branch from 5d08a02 to 8275b7e Oct 18, 2019
Copy link
Member

neolit123 left a comment

/lgtm
thanks, please wait for approval.

@neolit123

This comment has been minimized.

Copy link
Member

neolit123 commented Oct 18, 2019

/assign @dims

@dims

This comment has been minimized.

Copy link
Member

dims commented Oct 18, 2019

/approve

@k8s-ci-robot

This comment has been minimized.

Copy link

k8s-ci-robot commented Oct 18, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, longkai, neolit123

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 410ed91 into kubernetes:master Oct 18, 2019
2 of 3 checks passed
2 of 3 checks passed
tide Not mergeable. Needs approved label.
Details
cla/linuxfoundation longkai authorized
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.