1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-21 19:06:00 +00:00

accesslog: add Truncate method as requested at #1631

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-14 12:15:08 +03:00
parent 54a095c23f
commit 701713efdb
3 changed files with 52 additions and 2 deletions

View File

@@ -169,10 +169,16 @@ type (
Format(log *Log) (bool, error)
}
// Flusher can be implemented by a Formatter
// Flusher can be implemented by a Writer or Formatter
// to call its Flush method on AccessLog.Close
// and on panic errors.
Flusher interface{ Flush() error }
// BufferTruncater can be implemented by writers
// that support buffering.
BufferTruncater interface{ Truncate(n int) }
// FileTruncater can be implemented by files
// that can support runtime size change.
FileTruncater interface{ Truncate(size int64) error }
)
var (