diff --git a/src/index.js b/src/index.js index 3ccce7eb..3894d843 100644 --- a/src/index.js +++ b/src/index.js @@ -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'); /** @@ -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 = {}; diff --git a/test/index.js b/test/index.js index e1a9311d..2b333b87 100644 --- a/test/index.js +++ b/test/index.js @@ -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; @@ -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; }; @@ -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)); });