Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

feat: logging can be enabled via env var #181

Merged
merged 1 commit into from
Feb 20, 2020
Merged

Conversation

devjgm
Copy link
Contributor

@devjgm devjgm commented Feb 20, 2020

Users can now enable logging to std::clog without any code changes or
recompiling their code simply by setting the
"GOOGLE_CLOUD_CPP_ENABLE_CLOG" environment variable before running their
program.

This env var is currently being inspected and set in some of our other
code, such as
https://github.com/googleapis/google-cloud-cpp-spanner/blob/20e2f9b011e3747fe5a8b8dc284245c11ff354b6/google/cloud/spanner/connection_options.cc#L68,
and we should remove that after this change is merged.


This change is Reviewable

Users can now enable logging to `std::clog` without any code changes or
recompiling their code simply by setting the
"GOOGLE_CLOUD_CPP_ENABLE_CLOG" environment variable before running their
program.

This env var is currently being inspected and set in some of our other
code, such as
https://github.com/googleapis/google-cloud-cpp-spanner/blob/20e2f9b011e3747fe5a8b8dc284245c11ff354b6/google/cloud/spanner/connection_options.cc#L68,
and we should remove that after this change is merged.
@devjgm devjgm requested a review from devbww February 20, 2020 18:04
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 20, 2020
@codecov
Copy link

codecov bot commented Feb 20, 2020

Codecov Report

Merging #181 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
- Coverage   96.23%   96.23%   -0.01%     
==========================================
  Files          97       97              
  Lines        4411     4406       -5     
==========================================
- Hits         4245     4240       -5     
  Misses        166      166
Impacted Files Coverage Δ
google/cloud/log.h 86.84% <ø> (ø) ⬆️
google/cloud/connection_options.cc 100% <ø> (ø) ⬆️
google/cloud/connection_options_test.cc 100% <ø> (ø) ⬆️
google/cloud/connection_options.h 100% <100%> (ø) ⬆️
google/cloud/log.cc 94.59% <100%> (+0.39%) ⬆️
google/cloud/log_test.cc 98.3% <100%> (+0.13%) ⬆️

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 c1a0fa6...16160e2. Read the comment docs.

@devjgm devjgm merged commit bc0d111 into googleapis:master Feb 20, 2020
@devjgm devjgm deleted the log-env branch February 20, 2020 18:26
coryan pushed a commit to coryan/google-cloud-cpp that referenced this pull request Apr 24, 2020
…-common#181)

Users can now enable logging to `std::clog` without any code changes or
recompiling their code simply by setting the
"GOOGLE_CLOUD_CPP_ENABLE_CLOG" environment variable before running their
program.

This env var is currently being inspected and set in some of our other
code, such as
https://github.com/googleapis/google-cloud-cpp-spanner/blob/20e2f9b011e3747fe5a8b8dc284245c11ff354b6/google/cloud/spanner/connection_options.cc#L68,
and we should remove that after this change is merged.
coryan pushed a commit to coryan/google-cloud-cpp that referenced this pull request Apr 24, 2020
…-common#181)

Users can now enable logging to `std::clog` without any code changes or
recompiling their code simply by setting the
"GOOGLE_CLOUD_CPP_ENABLE_CLOG" environment variable before running their
program.

This env var is currently being inspected and set in some of our other
code, such as
https://github.com/googleapis/google-cloud-cpp-spanner/blob/20e2f9b011e3747fe5a8b8dc284245c11ff354b6/google/cloud/spanner/connection_options.cc#L68,
and we should remove that after this change is merged.
coryan pushed a commit to coryan/google-cloud-cpp that referenced this pull request Apr 24, 2020
…-common#181)

Users can now enable logging to `std::clog` without any code changes or
recompiling their code simply by setting the
"GOOGLE_CLOUD_CPP_ENABLE_CLOG" environment variable before running their
program.

This env var is currently being inspected and set in some of our other
code, such as
https://github.com/googleapis/google-cloud-cpp-spanner/blob/20e2f9b011e3747fe5a8b8dc284245c11ff354b6/google/cloud/spanner/connection_options.cc#L68,
and we should remove that after this change is merged.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants