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

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

Open
orrymr opened this issue Oct 18, 2024 · 0 comments
Open

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

orrymr opened this issue Oct 18, 2024 · 0 comments
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@orrymr
Copy link

orrymr commented Oct 18, 2024

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"

@orrymr orrymr added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 18, 2024
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging API. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants