improve cookie feature for ghttp.Server

This commit is contained in:
Jack
2020-08-03 20:00:00 +08:00
parent 3e3b5557f7
commit 6d68277db8
3 changed files with 97 additions and 56 deletions

View File

@ -104,8 +104,10 @@ func (l *Logger) print(std io.Writer, lead string, values ...interface{}) {
// It here uses CAP for performance and concurrent safety.
if !l.init.Val() && l.init.Cas(false, true) {
// It just initializes once for each logger.
gtimer.AddOnce(l.config.RotateCheckInterval, l.rotateChecksTimely)
intlog.Printf("logger initialized: every %s", l.config.RotateCheckInterval.String())
if l.config.RotateSize > 0 || l.config.RotateExpire > 0 {
gtimer.AddOnce(l.config.RotateCheckInterval, l.rotateChecksTimely)
intlog.Printf("logger rotation initialized: every %s", l.config.RotateCheckInterval.String())
}
}
var (