github.com/searKing/golang/go@v1.2.117/log/slog/rotate.options.go (about) 1 // Copyright 2021 The searKing Author. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package slog 6 7 import ( 8 time_ "github.com/searKing/golang/go/time" 9 ) 10 11 // WithRotateFilePathRotateStrftime sets time layout in strftime format to format rotate file. 12 func WithRotateFilePathRotateStrftime(layout string) RotateOption { 13 return RotateOptionFunc(func(r *rotate) { 14 r.FilePathRotateLayout = time_.LayoutStrftimeToSimilarTime(layout) 15 }) 16 }