dbcli / pgcli

Postgres CLI with autocompletion and syntax highlighting
http://pgcli.com
BSD 3-Clause "New" or "Revised" License
12.04k stars 553 forks source link

Add --log-file & \log-file option to always capture output #1461

Closed saucoide closed 5 months ago

saucoide commented 5 months ago

Description

Currently outputting to a file via \o disables the console output, however i often find myself wanting to both log the results & see them in the terminal too #1424

This patch would add a cli arg --log-file, behaving as the same option in psql* + a \log-file special command to enable/disable it from the console

* https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-OPTION-LOG-FILE

Maybe this is just useful for me and not worth adding but thought i'd submit it anyway, i'll update changelog, etc later if you decide it's ok to merge

Checklist

j-bennet commented 5 months ago

@saucoide This can be useful, sure. Go ahead with the PR. Thank you!

j-bennet commented 5 months ago

Thank you @saucoide