-
Notifications
You must be signed in to change notification settings - Fork 224
/
log-min-error-statement.ts
28 lines (23 loc) · 1.08 KB
/
log-min-error-statement.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import {Args} from '@oclif/core'
import heredoc from 'tsheredoc'
import {PGSettingsCommand} from '../../../lib/pg/setter'
import type {Setting, SettingKey} from '../../../lib/pg/types'
import {nls} from '../../../nls'
export default class LogMinErrorStatement extends PGSettingsCommand {
static description = heredoc(`
log-min-error-statement controls the logging of SQL statements that cause an error at a specified severity level.
This setting is useful to prevent logging SQL queries that might contain sensitive information.
Use this setting to prevent logging SQL queries that contain sensitive information. Default is "error".
`)
static args = {
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
value: Args.string({options: ['error', 'log', 'fatal', 'panic']}),
}
protected settingKey: SettingKey = 'log_min_error_statement'
protected convertValue(val: string): string {
return val
}
protected explain(setting: Setting<string>) {
return setting.values[setting.value]
}
}