UNPKG

880 BJavaScriptView Raw
1'use strict'
2
3const cli = require('heroku-cli-util')
4const settings = require('../../lib/setter')
5
6function explain (setting) {
7 if (setting.value) {
8 return `When login attempts are made, a log message will be emitted in your application's logs.`
9 }
10 return `When login attempts are made, no log message will be emitted in your application's logs.`
11}
12
13module.exports = {
14 topic: 'pg',
15 command: 'settings:log-connections',
16 description: `Controls whether a log message is produced when a login attempt is made. Default is true.`,
17 help: `Setting log_connections to false stops emitting log messages for all attempts to login to the database.`,
18 needsApp: true,
19 needsAuth: true,
20 args: [{ name: 'value', optional: true }, { name: 'database', optional: true }],
21 run: cli.command({ preauth: true }, settings.generate('log_connections', settings.boolean, explain))
22}