Skip to content

Commit

Permalink
logging: restore library version to api-client header (#2540)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored Aug 18, 2017
1 parent 89bfd37 commit 9cef603
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var pumpify = require('pumpify');
var streamEvents = require('stream-events');
var through = require('through2');

var PKG = require('../package.json');
var v2 = require('./v2');

/**
Expand Down Expand Up @@ -72,7 +73,9 @@ function Logging(options) {
}

var options_ = extend({
scopes: v2.ALL_SCOPES
scopes: v2.ALL_SCOPES,
libName: 'gccl',
libVersion: PKG.version
}, options);

this.api = {};
Expand Down
9 changes: 7 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var proxyquire = require('proxyquire');
var through = require('through2');
var util = require('@google-cloud/common').util;

var PKG = require('../package.json');
var v2 = require('../src/v2/index.js');

var extended = false;
Expand Down Expand Up @@ -181,7 +182,9 @@ describe('Logging', function() {

googleAutoAuthOverride = function(options_) {
assert.deepEqual(options_, extend({
scopes: v2.ALL_SCOPES
scopes: v2.ALL_SCOPES,
libName: 'gccl',
libVersion: PKG.version
}, options));
return fakeGoogleAutoAuthInstance;
};
Expand All @@ -201,7 +204,9 @@ describe('Logging', function() {
assert.notStrictEqual(logging.options, options);

assert.deepEqual(logging.options, extend({
scopes: v2.ALL_SCOPES
scopes: v2.ALL_SCOPES,
libName: 'gccl',
libVersion: PKG.version
}, options));
});

Expand Down

0 comments on commit 9cef603

Please sign in to comment.