logging: add CREATE flag to file-based loggers.
This commit is contained in:
parent
7e118bfdb0
commit
6f19b69bbd
|
@ -59,7 +59,7 @@ func NewSplitFile(outpath, errpath string, overwrite bool) (*File, error) {
|
||||||
if overwrite {
|
if overwrite {
|
||||||
fl.fo, err = os.Create(outpath)
|
fl.fo, err = os.Create(outpath)
|
||||||
} else {
|
} else {
|
||||||
fl.fo, err = os.OpenFile(outpath, os.O_WRONLY|os.O_APPEND, 0644)
|
fl.fo, err = os.OpenFile(outpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -69,7 +69,7 @@ func NewSplitFile(outpath, errpath string, overwrite bool) (*File, error) {
|
||||||
if overwrite {
|
if overwrite {
|
||||||
fl.fe, err = os.Create(errpath)
|
fl.fe, err = os.Create(errpath)
|
||||||
} else {
|
} else {
|
||||||
fl.fe, err = os.OpenFile(errpath, os.O_WRONLY|os.O_APPEND, 0644)
|
fl.fe, err = os.OpenFile(errpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue