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

Everything involving "logLevel" is awful #740

Open
exo-pla-net opened this issue Apr 11, 2024 · 0 comments
Open

Everything involving "logLevel" is awful #740

exo-pla-net opened this issue Apr 11, 2024 · 0 comments
Assignees
Labels
api: clouderrorreporting Issues related to the googleapis/nodejs-error-reporting API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@exo-pla-net
Copy link

Given

new ErrorReporting(initConfiguration?: ConfigurationOptions)

and

export interface ConfigurationOptions {
    logLevel?: string | number;
   ...
}

A user has no idea what "logLevel" means / will induce with the error report. Allowing it to be a string or a number has a rather wide possibility space! And what it does is not mentioned in the docs.

I think what was intended was for "logLevel" to represent Severity.

I furthermore think that, instead of the type being:

logLevel?: string | number

It was intended to be / ought to be:

logLevel?: LogLevel

Per google-cloud\error-reporting\build\src\configuration.d.ts:

export type LogLevel = 'error' | 'trace' | 'debug' | 'info' | 'warn' | 'fatal' | undefined;

I propose that "logLevel" be renamed "severity", with:

export interface ConfigurationOptions {
    severity?: LogSeverity ;
   ...
}

and

export type LogSeverity = 'error' | 'trace' | 'debug' | 'info' | 'warn' | 'fatal' | undefined;

I furthermore propose that LogSeverity be mentioned in the docs.

@exo-pla-net exo-pla-net added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Apr 11, 2024
@product-auto-label product-auto-label bot added the api: clouderrorreporting Issues related to the googleapis/nodejs-error-reporting API. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: clouderrorreporting Issues related to the googleapis/nodejs-error-reporting API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants