nodejs-error-reporting
nodejs-error-reporting copied to clipboard
Everything involving "logLevel" is awful
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.