Skip to content

Use lazy logging format#5377

Merged
AlexandreYang merged 6 commits into
masterfrom
alex/logging_format
Jan 5, 2020
Merged

Use lazy logging format#5377
AlexandreYang merged 6 commits into
masterfrom
alex/logging_format

Conversation

@AlexandreYang

@AlexandreYang AlexandreYang commented Jan 3, 2020

Copy link
Copy Markdown
Member

What does this PR do?

Use lazy log format using this script:

https://gist.github.com/AlexandreYang/2b45a2b086953c93b8bf2e1d7e5f7a60

What's handled?

  • Only handle single line format string (logger first argument) e.g. self.log.info("<SINGLE_LINE>", e)
  • Handle percent cases
  • Handle .format() cases with {} and one {0}

What's NOT handled?

  • .format() with named interpolation and more than one number interpolation {0}
  • multiline format string pattern (first argument of the logger)

Motivation

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov

codecov Bot commented Jan 3, 2020

Copy link
Copy Markdown

@codecov

codecov Bot commented Jan 3, 2020

Copy link
Copy Markdown

Codecov Report

Merging #5377 into master will decrease coverage by 0.11%.
The diff coverage is 44.44%.

Impacted Files Coverage Δ
mcache/datadog_checks/mcache/mcache.py 91.33% <0%> (ø)
postfix/datadog_checks/postfix/postfix.py 57.14% <0%> (ø) ⬆️
...master/datadog_checks/mesos_master/mesos_master.py 85.82% <0%> (ø)
kubelet/datadog_checks/kubelet/cadvisor.py 77.06% <0%> (ø) ⬆️
kubelet/datadog_checks/kubelet/prometheus.py 80.87% <0%> (ø) ⬆️
..._fargate/datadog_checks/ecs_fargate/ecs_fargate.py 67.94% <0%> (ø) ⬆️
openstack/datadog_checks/openstack/openstack.py 40.66% <0%> (ø) ⬆️
nginx/datadog_checks/nginx/nginx.py 89.61% <0%> (ø) ⬆️
...atadog_checks/kubernetes_state/kubernetes_state.py 80.98% <0%> (ø) ⬆️
mapr/datadog_checks/mapr/mapr.py 73.03% <0%> (ø) ⬆️
... and 162 more

Comment thread datadog_checks_base/tox.ini Outdated
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
#

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note: this is for triggering PR All pipeline

@AlexandreYang
AlexandreYang marked this pull request as ready for review January 3, 2020 16:55
@AlexandreYang
AlexandreYang requested review from a team as code owners January 3, 2020 16:55
@AlexandreYang AlexandreYang changed the title Use Lazy log format Use lazy logging format Jan 3, 2020
@AlexandreYang

Copy link
Copy Markdown
Member Author

/azp help

@azure-pipelines

Copy link
Copy Markdown
Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@AlexandreYang

Copy link
Copy Markdown
Member Author

/azp list

@azure-pipelines

Copy link
Copy Markdown
CI/CD Pipelines for this repository:

@AlexandreYang

Copy link
Copy Markdown
Member Author

/azp run PR All

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@ofek ofek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome!!!!!!!!!

@AlexandreYang
AlexandreYang merged commit ef74bfb into master Jan 5, 2020
@AlexandreYang
AlexandreYang deleted the alex/logging_format branch January 5, 2020 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment