mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Append to debug log files, don't clobber.
This commit is contained in:
parent
6d1e7ab1eb
commit
b1c3649eac
@ -6,6 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/hashicorp/logutils"
|
"github.com/hashicorp/logutils"
|
||||||
)
|
)
|
||||||
@ -31,7 +32,7 @@ func LogOutput() (logOutput io.Writer, err error) {
|
|||||||
logOutput = os.Stderr
|
logOutput = os.Stderr
|
||||||
if logPath := os.Getenv(EnvLogFile); logPath != "" {
|
if logPath := os.Getenv(EnvLogFile); logPath != "" {
|
||||||
var err error
|
var err error
|
||||||
logOutput, err = os.Create(logPath)
|
logOutput, err = os.OpenFile(logPath, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user