1234567891011121314151617181920212223 |
- package logging
- import (
- "fmt"
- "time"
- )
- // getLogFilePath get the log file save path
- func getLogFilePath() string {
- return fmt.Sprintf("%s%s", "runtime/", "logs/")
- }
- // getLogFileName get the save name of the log file
- func getLogFileName() string {
- year, month, day := time.Now().Date()
- formatStr := fmt.Sprintf("%d%d%d", year, month, day)
- return fmt.Sprintf("%s%s.%s",
- "log-",
- formatStr,
- "log",
- )
- }
|