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 (
"context"
"io"
"log/slog"
"os"
"reflect"
@ -10,6 +11,7 @@ import (
"strconv"
"sync"
"sync/atomic"
"time"
"go.unistack.org/micro/v3/logger"
"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{}) {
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)
}