file.go 417 B

1234567891011121314151617181920212223
  1. package logging
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. // getLogFilePath get the log file save path
  7. func getLogFilePath() string {
  8. return fmt.Sprintf("%s%s", "runtime/", "logs/")
  9. }
  10. // getLogFileName get the save name of the log file
  11. func getLogFileName() string {
  12. year, month, day := time.Now().Date()
  13. formatStr := fmt.Sprintf("%d%d%d", year, month, day)
  14. return fmt.Sprintf("%s%s.%s",
  15. "log-",
  16. formatStr,
  17. "log",
  18. )
  19. }