feat(logger): add O_TRUNC flag
This commit is contained in:
parent
e39b764856
commit
120906f7a6
1 changed files with 1 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ func Load(path string, level slog.Level) error {
|
|||
return err
|
||||
}
|
||||
|
||||
file, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, os.ModePerm)
|
||||
file, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open log file: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue