Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

[MTB] Added leveled logging #981

Merged
merged 3 commits into from
Aug 20, 2020
Merged

Conversation

Divya063
Copy link
Contributor

@Divya063 Divya063 commented Aug 2, 2020

This PR supports two modes for logging, production and development.
User can switch to dev mode by specifying -v debug
closes #958

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 2, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @Divya063. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 2, 2020
@Divya063 Divya063 changed the title Added leveled logging [MTB] Added leveled logging Aug 2, 2020
@Divya063
Copy link
Contributor Author

Divya063 commented Aug 2, 2020

/assign @JimBugwadia

@@ -24,7 +25,7 @@ var b = &benchmark.Benchmark{

lists, err := kclient.Discovery().ServerPreferredResources()
if err != nil {
return nil
log.Logging.Debug(err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

add return err

@@ -49,6 +52,8 @@ var b = &benchmark.Benchmark{
_, err = tclient.CoreV1().Pods(tenantNamespace).Create(context.TODO(), pod, metav1.CreateOptions{DryRun: []string{metav1.DryRunAll}})
if err == nil {
return fmt.Errorf("Tenant must be unable to create pod with add capabilities")
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove else clause

@JimBugwadia
Copy link
Contributor

@Divya063 - typically the - v flag takes a numeric level (this is based on glog.) So, perhaps we should just allow a --debug flag?

@JimBugwadia
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 14, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 16, 2020
@Divya063
Copy link
Contributor Author

@JimBugwadia I have added the debug flag

@JimBugwadia
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Divya063, JimBugwadia

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2020
@k8s-ci-robot k8s-ci-robot merged commit ffb958c into kubernetes-retired:master Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MTB] add leveled logging
4 participants