googleapis/nodejs-logging

README client constructor example incorrect (likely out of date).

Opened this issue · 0 comments

In the Using the client library part of the readme, we have the following snippet of code:

// Creates a client
const logging = new Logging({projectId});

However, I believe this should be changed to:

// Creates a client
const logging = new Logging();
logging.setProjectId({projectId});

My assumption is that projectId was removed from the constructor in order to allow the client to dynamically connect to several projects; that is during the running of the program it may dynamically switch which project it is connect to.

I am using "@google-cloud/logging": "^11.2.0"