Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

fix: fix log messages and ignore falsey env vars#724

Merged
kjin merged 2 commits intogoogleapis:masterfrom
kjin:log-2
Apr 17, 2018
Merged

fix: fix log messages and ignore falsey env vars#724
kjin merged 2 commits intogoogleapis:masterfrom
kjin:log-2

Conversation

@kjin
Copy link
Copy Markdown
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
Copy Markdown

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
Comment thread src/index.ts
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
Copy Markdown
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 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