mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
app/log/RotatingFile.go: Adding GetFilename()
This commit is contained in:
parent
03ab664130
commit
89f47c06df
1 changed files with 4 additions and 0 deletions
|
|
@ -58,6 +58,10 @@ func (w *RotatingFile) newFilename(name string) string {
|
|||
return fmt.Sprintf("%s-%s%s", name, time.Now().Format(w.format), ext)
|
||||
}
|
||||
|
||||
func (w RotatingFile) GetFilename() string {
|
||||
return path.Base(w.fd.Name())
|
||||
}
|
||||
|
||||
// Rotate the file.
|
||||
func (w *RotatingFile) Rotate() error {
|
||||
dst, err := os.OpenFile(w.newFilename(w.fd.Name()), os.O_CREATE|os.O_WRONLY, 0o666)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue