Append logs instead instead overwriting (#2215)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2025-10-20 23:48:44 +02:00
1 parent bbfef3e832
commit cc112beb78
3 files changed
+3 -2

No files matched your search

+1
View File
@@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- The experimental `locale` option has been removed in favor of the recommendation to use `addcustominfo`/`set sortby custom` for custom sorting (#2111).
- The existing `doc` command has been renamed to `help` so that it is more natural for users (#2125).
- 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/^/ /'`.
- Logs generated by `-log <path>` now get appended to `<path>` instead of overwriting it (#2215).
### Added
+1 -1
View File
@@ -27,7 +27,7 @@ func init() {
func run() {
if gLogPath != "" {
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o600)
if err != nil {
log.Fatalf("failed to open log file: %s", err)
}
+1 -1
View File
@@ -17,7 +17,7 @@ var (
func serve() {
if gLogPath != "" {
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
f, err := os.OpenFile(gLogPath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o600)
if err != nil {
log.Fatalf("failed to open log file: %s", err)
}