-
Notifications
You must be signed in to change notification settings - Fork 65
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
LogSeverity not exported from @google-cloud/logging. #1402
Comments
Thanks @RastogiAbhijeet for opening this issue! |
Hey @losalex , My use case is pretty straightforward, Currently the Severity enum exported by the @gooogle-cloud@logging node-module is mapping to numbers.
I can maybe also use SeverityName which can help me to get the severity names ( as I would expect ) but it does so in the lower case. But the issue with both cases is that the severity is not properly reflected in the Cloud Log Explorer in the GCP console. So for eg: Now if you look at this link, it will show the correct number that should be used for the severity. https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity. Another reason why I started to chase LogSeverity is because as I digged into the
Ofcourse, I might be looking at the wrong place but how the types are being managed so of didn't make a lot of sense. Honestly, I would label this as a bug and hope it gets fixed. Hope it helps. Happy to chat through it if anything above didn't make sense. |
If you are interested in just the enum type, you can try something like import { Entry } from '@google-cloud/logging';
export type LogSeverityType = Exclude<
NonNullable<Entry['metadata']['severity']>,
string
>; But if you want the enum values, I am not sure if that's possible without explicit export. I asked this SO question in case it's possible. |
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Is this a client library issue or a product issue?
It is a client library issue
Did someone already solve this?
No.
Do you have a support contract?
It's client-lib related issue.
If the support paths suggested above still do not result in a resolution, please provide the following details.
Environment details
@google-cloud/logging
version: 10.3.3Steps to reproduce
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: