feat(cmd/joj3): shorter runID
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m19s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-10-31 20:21:47 -04:00
parent d42b97673a
commit 9d43539da7
GPG Key ID: D47306D7062CDA9D

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"log/slog" "log/slog"
"os" "os"
"strconv"
"time" "time"
) )
@ -17,7 +18,9 @@ type multiHandler struct {
var runID string var runID string
func init() { func init() {
runID = fmt.Sprintf("%d-%d", time.Now().UnixNano(), os.Getpid()) runID = fmt.Sprintf("%06s%04s",
strconv.FormatInt(time.Now().Unix(), 36),
strconv.FormatInt(int64(os.Getpid()), 36))
} }
func (h *multiHandler) Enabled(ctx context.Context, level slog.Level) bool { func (h *multiHandler) Enabled(ctx context.Context, level slog.Level) bool {