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: fix log messages and ignore falsey env vars #724

Merged
merged 2 commits into from
Apr 17, 2018
Merged

Conversation

kjin
Copy link
Contributor

@kjin kjin commented Apr 16, 2018

This change causes the Trace Agent to now ignore empty string environmental variables. Formerly,

GCLOUD_PROJECT= node app.js

would initialize the projectId field to an empty string.

This change also fixes a few log message contents, and adds two info-level log messages for when new spans are created.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 16, 2018
@codecov
Copy link

codecov bot commented Apr 16, 2018

Codecov Report

Merging #724 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #724      +/-   ##
==========================================
+ Coverage   90.74%   90.76%   +0.02%     
==========================================
  Files          28       28              
  Lines        1491     1495       +4     
  Branches      294      296       +2     
==========================================
+ Hits         1353     1357       +4     
  Misses         59       59              
  Partials       79       79
Impacted Files Coverage Δ
src/index.ts 92% <100%> (+0.21%) ⬆️
src/trace-writer.ts 91.59% <100%> (ø) ⬆️
src/trace-api.ts 94.38% <100%> (+0.12%) ⬆️

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 59fabcc...9bcdd33. Read the comment docs.

@kjin kjin changed the title [wip] fix: fix log messages and ignore falsey env vars fix: fix log messages and ignore falsey env vars Apr 16, 2018
src/index.ts Outdated
@@ -69,16 +69,18 @@ function initConfig(projectConfig: Forceable<Config>):
Forceable<NormalizedConfig> {
const envConfig = {
logLevel: Number(process.env.GCLOUD_TRACE_LOGLEVEL) || undefined,
projectId: process.env.GCLOUD_PROJECT,
projectId: process.env.GCLOUD_PROJECT || undefined,

This comment was marked as spam.

@kjin
Copy link
Contributor Author

kjin commented Apr 17, 2018

Node 6 CI passes despite failure output (which is due to this PR not being rebased on #723)

@kjin kjin merged commit d0337fa into googleapis:master Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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