Skip to content

Commit cc112be

Browse files
Append logs instead instead overwriting (#2215)
1 parent bbfef3e commit cc112be

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4343
- The experimental `locale` option has been removed in favor of the recommendation to use `addcustominfo`/`set sortby custom` for custom sorting (#2111).
4444
- The existing `doc` command has been renamed to `help` so that it is more natural for users (#2125).
4545
- Text previews are no longer displayed with a padding of two spaces by default (#2131). Instead, a custom padding can be added in the `previewer` script, for example by piping to `sed 's/^/ /'`.
46+
- Logs generated by `-log <path>` now get appended to `<path>` instead of overwriting it (#2215).
4647

4748
### Added
4849

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func init() {
2727

2828
func run() {
2929
if gLogPath != "" {
30-
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
30+
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o600)
3131
if err != nil {
3232
log.Fatalf("failed to open log file: %s", err)
3333
}

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var (
1717

1818
func serve() {
1919
if gLogPath != "" {
20-
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
20+
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o600)
2121
if err != nil {
2222
log.Fatalf("failed to open log file: %s", err)
2323
}

0 commit comments

Comments
 (0)