util/id: add uuid v8 #382

Merged
vtolstov merged 4 commits from id into v3 2024-12-22 22:23:01 +03:00
Showing only changes of commit 86d99f086e - Show all commits

View File

@ -2,6 +2,7 @@ package slog
import ( import (
"context" "context"
"io"
"log/slog" "log/slog"
"os" "os"
"reflect" "reflect"
@ -10,6 +11,7 @@ import (
"strconv" "strconv"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time"
"go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v3/logger"
"go.unistack.org/micro/v3/semconv" "go.unistack.org/micro/v3/semconv"
@ -224,6 +226,10 @@ func (s *slogLogger) Error(ctx context.Context, msg string, attrs ...interface{}
func (s *slogLogger) Fatal(ctx context.Context, msg string, attrs ...interface{}) { func (s *slogLogger) Fatal(ctx context.Context, msg string, attrs ...interface{}) {
s.printLog(ctx, logger.FatalLevel, msg, attrs...) s.printLog(ctx, logger.FatalLevel, msg, attrs...)
if closer, ok := s.opts.Out.(io.Closer); ok {
closer.Close()
}
time.Sleep(1 * time.Second)
os.Exit(1) os.Exit(1)
} }