Skip to content

Commit

Permalink
Ability to serve transports, Dockerfile update (docker-compose not ye…
Browse files Browse the repository at this point in the history
…t working) + pprof implementation
  • Loading branch information
0x19 committed Sep 17, 2024
1 parent f6adddb commit 82db400
Show file tree
Hide file tree
Showing 21 changed files with 314 additions and 51 deletions.
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
FROM golang:1.23-alpine AS builder

# Install necessary build tools
RUN apk add --no-cache make gcc musl-dev
RUN apk add --no-cache make git gcc musl-dev

# Set the working directory inside the container
WORKDIR /app
WORKDIR /fdb

# Copy the Go modules manifest and download dependencies
COPY go.mod go.sum ./
Expand All @@ -21,12 +21,19 @@ RUN make build
FROM alpine:latest

# Set the working directory inside the container
WORKDIR /app
WORKDIR /fdb

# Copy the built executable from the builder stage
COPY --from=builder /app/build/fdb /app/fdb
COPY --from=builder /fdb/build/fdb /fdb/fdb

# EXPOSE 0000
# Copy the YAML configuration file
COPY config.yaml /fdb/config.yaml

# Command to run the server
CMD ["./fdb", "serve"]
# Copy the certificate files
COPY data/certs/ /fdb/data/certs/

# Expose the necessary ports from the config file
EXPOSE 4434 4433 5011 5022 4060

# Command to run the server with the configuration file
CMD ["./fdb", "serve", "--config", "./config.yaml"]
2 changes: 1 addition & 1 deletion benchmark/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (ds *DummySuite) Start(ctx context.Context) error {
rHandler := transport_dummy.NewDummyReadHandler(db)
dummyServer.RegisterHandler(types.ReadHandlerType, rHandler.HandleMessage)

if sErr := dummyServer.Start(); sErr != nil {
if sErr := dummyServer.Start(ctx); sErr != nil {
zap.L().Error(
"failed to start dummy transport",
zap.Error(sErr),
Expand Down
2 changes: 1 addition & 1 deletion benchmark/quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (qs *QuicSuite) Start(ctx context.Context) error {
rHandler := transport_quic.NewQuicReadHandler(bDb)
quicServer.RegisterHandler(types.ReadHandlerType, rHandler.HandleMessage)

if err := quicServer.Start(); err != nil {
if err := quicServer.Start(ctx); err != nil {
return fmt.Errorf("failed to start QUIC server: %w", err)
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (ts *TcpSuite) Start(ctx context.Context) error {
rHandler := transport_tcp.NewTCPReadHandler(bDb)
tcpServer.RegisterHandler(types.ReadHandlerType, rHandler.HandleMessage)

if sErr := tcpServer.Start(); sErr != nil {
if sErr := tcpServer.Start(ctx); sErr != nil {
zap.L().Error("failed to start TCP transport", zap.Error(sErr))
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (us *UdpSuite) Start(ctx context.Context) error {
rHandler := transport_udp.NewUDPReadHandler(bDb)
udpServer.RegisterHandler(types.ReadHandlerType, rHandler.HandleMessage)

if sErr := udpServer.Start(); sErr != nil {
if sErr := udpServer.Start(ctx); sErr != nil {
zap.L().Error("failed to start UDP transport", zap.Error(sErr))
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/uds.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (us *UdsSuite) Start(ctx context.Context) error {
rHandler := transport_uds.NewUDSReadHandler(bDb)
udsServer.RegisterHandler(types.ReadHandlerType, rHandler.HandleMessage)

if sErr := udsServer.Start(); sErr != nil {
if sErr := udsServer.Start(ctx); sErr != nil {
zap.L().Error("failed to start UDS transport", zap.Error(sErr))
}

Expand Down
6 changes: 4 additions & 2 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func ServeCommand() *cli.Command {
},
&cli.StringSliceFlag{
Name: "transports",
Usage: "Specify the transport types (e.g., quic, uds)",
Value: cli.NewStringSlice("quic", "uds"), // Corrected default initialization
Usage: "Specify the transport types",
Value: cli.NewStringSlice("quic", "uds", "tcp", "udp"),
},
},
Action: func(c *cli.Context) error {
Expand All @@ -47,6 +47,8 @@ func ServeCommand() *cli.Command {

transports = append(transports, tt)
}

defer fdbc.Stop(transports...)
return fdbc.Start(c.Context, transports...)
},
}
Expand Down
7 changes: 6 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
logger:
enabled: true
environment: development
level: debug
level: info

mdbx:
enabled: true
Expand All @@ -14,6 +14,11 @@ mdbx:
growthStep: 4096 # Growth step size (4 KB)
filePermissions: 0600 # File permissions for the database

pprof:
- name: fdb
enabled: true
addr: "127.0.0.1:4060"

transports:
- type: dummy
enabled: true
Expand Down
33 changes: 18 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,36 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080" # Map the container's port 8080 to the host
- "4434:4434" # Mapping the dummy service port
- "4433:4433" # Mapping the QUIC service port
- "5011:5011" # Mapping the TCP service port
- "5022:5022" # Mapping the UDP service port
- "4060:4060" # Mapping for pprof
restart: always
environment:
- ENV_VAR1=value1
- ENV_VAR2=value2
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 # OpenTelemetry Collector endpoint
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 # OpenTelemetry Collector endpoint
volumes:
- ./data:/app/data
command: ["./fdb", "serve"]
- ./data:/app/data # Mounting the data directory for certs and other resources
- ./config.yaml:/fdb/config.yaml # Mounting the configuration file
command: ["./fdb", "serve", "--config", "/fdb/config.yaml"]
depends_on:
- otel-collector # Ensure fdb service starts after the OpenTelemetry collector
- otel-collector # Ensure fdb service starts after OpenTelemetry collector

otel-collector:
image: otel/opentelemetry-collector:latest
ports:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "55680:55680" # OpenTelemetry protocol receiver
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "55680:55680" # OpenTelemetry protocol receiver
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml # Mount the custom config for the OpenTelemetry collector
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml # Mounting custom config for OpenTelemetry collector

jaeger:
image: jaegertracing/all-in-one:1.29
ports:
- "16686:16686" # Jaeger UI
- "14250:14250" # Jaeger gRPC
- "6831:6831/udp" # Jaeger UDP port for traces
- "16686:16686" # Jaeger UI
- "14250:14250" # Jaeger gRPC
- "6831:6831/udp" # Jaeger UDP port for traces
environment:
- COLLECTOR_ZIPKIN_HTTP_PORT=9411
- COLLECTOR_ZIPKIN_HTTP_PORT=9411 # Zipkin compatibility mode
57 changes: 56 additions & 1 deletion fdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/unpackdev/fdb/config"
"github.com/unpackdev/fdb/db"
"github.com/unpackdev/fdb/logger"
"github.com/unpackdev/fdb/pprof"
"github.com/unpackdev/fdb/transports"
transport_dummy "github.com/unpackdev/fdb/transports/dummy"
transport_quic "github.com/unpackdev/fdb/transports/quic"
Expand All @@ -15,6 +16,7 @@ import (
transport_uds "github.com/unpackdev/fdb/transports/uds"
"github.com/unpackdev/fdb/types"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
)

type FDB struct {
Expand Down Expand Up @@ -108,10 +110,63 @@ func New(ctx context.Context, cnf config.Config) (*FDB, error) {
}

func (fdb *FDB) Start(ctx context.Context, transports ...types.TransportType) error {
return nil
g, gCtx := errgroup.WithContext(ctx)

bDb, err := fdb.GetDbManager().GetDb("fdb")
if err != nil {
return fmt.Errorf("failed to retrieve fdb database: %w", err)
}

pCfg, pcErr := fdb.config.GetPprofByServiceTag("fdb")
if pcErr != nil {
return errors.Wrapf(pcErr, "failed to retrieve fdb pprof config for service tag: %s", "fdb")
}

if pCfg.Enabled {
g.Go(func() error {
return pprof.New(ctx, *pCfg).Start()
})
}

for _, transport := range transports {
transportFn, tnOk := tRegistry[transport]
if !tnOk {
return fmt.Errorf("unknown transport type provided: %v - rejecting serving transports", transport)
}

iTransport, itErr := transportFn(fdb, bDb)
if itErr != nil {
return errors.Wrapf(itErr, "failure to create transport: %s", transport)
}

g.Go(func() error {
return iTransport.Start(gCtx)
})
}

if gErr := g.Wait(); gErr != nil {
return errors.Wrap(gErr, "failure to start fdb database")
}

select {
case <-ctx.Done():
return ctx.Err()
}
}

func (fdb *FDB) Stop(transports ...types.TransportType) error {
for _, transport := range transports {
t, tErr := fdb.tm.GetTransport(transport)
if tErr != nil {
return tErr
}

if err := t.Stop(); err != nil {
return err
}
}

zap.L().Info("All transports successfully stopped")
return nil
}

Expand Down
20 changes: 20 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ require (
require (
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/ianlancetaylor/cgosymbolizer v0.0.0-20240503222823-736c933a666d // indirect
github.com/onsi/ginkgo/v2 v2.20.2 // indirect
github.com/panjf2000/gnet/v2 v2.5.7 // indirect
Expand All @@ -27,6 +31,18 @@ require (
github.com/urfave/cli/v2 v2.27.4 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
go.opentelemetry.io/contrib/bridges/otelslog v0.5.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect
go.opentelemetry.io/otel v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 // indirect
go.opentelemetry.io/otel/log v0.6.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
go.opentelemetry.io/otel/sdk/log v0.6.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
Expand All @@ -36,7 +52,11 @@ require (
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
35 changes: 35 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/erigontech/mdbx-go v0.38.4 h1:S9T7mTe9KPcFe4dOoOtVdI6gPzht9y7wMnYfUBgrQLo=
github.com/erigontech/mdbx-go v0.38.4/go.mod h1:IcOLQDPw3VM/asP6T5JVPPN4FHHgJtY16XfYjzWKVNI=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134 h1:c5FlPPgxOn7kJz3VoPLkQYQXGBS3EklQ4Zfi57uOuqQ=
github.com/google/pprof v0.0.0-20240910150728-a0b0bb1d4134/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/ianlancetaylor/cgosymbolizer v0.0.0-20240503222823-736c933a666d h1:Azx2B59D4+zpVVtuYb8Oe3uOLi/ift4xfwKdhBX0Cy0=
github.com/ianlancetaylor/cgosymbolizer v0.0.0-20240503222823-736c933a666d/go.mod h1:DvXTE/K/RtHehxU8/GtDs4vFtfw64jJ3PaCnFri8CRg=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
Expand Down Expand Up @@ -67,6 +74,30 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opentelemetry.io/contrib/bridges/otelslog v0.5.0 h1:lU3F57OSLK5mQ1PDBVAfDDaKCPv37MrEbCfTzsF4bz0=
go.opentelemetry.io/contrib/bridges/otelslog v0.5.0/go.mod h1:I84u06zJFr8T5D73fslEUbnRBimVVSBhuVw8L8I92AU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI=
go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts=
go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc=
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0 h1:bZHOb8k/CwwSt0DgvgaoOhBXWNdWqFWaIsGTtg1H3KE=
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.6.0/go.mod h1:XlV163j81kDdIt5b5BXCjdqVfqJFy/LJrHA697SorvQ=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0 h1:IyFlqNsi8VT/nwYlLJfdM0y1gavxGpEvnf6FtVfZ6X4=
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.30.0/go.mod h1:bxiX8eUeKoAEQmbq/ecUT8UqZwCjZW52yJrXJUSozsk=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0 h1:kn1BudCgwtE7PxLqcZkErpD8GKqLZ6BSzeW9QihQJeM=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.30.0/go.mod h1:ljkUDtAMdleoi9tIG1R6dJUpVwDcYjw3J2Q6Q/SuiC0=
go.opentelemetry.io/otel/log v0.6.0 h1:nH66tr+dmEgW5y+F9LanGJUBYPrRgP4g2EkmPE3LeK8=
go.opentelemetry.io/otel/log v0.6.0/go.mod h1:KdySypjQHhP069JX0z/t26VHwa8vSwzgaKmXtIB3fJM=
go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w=
go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ=
go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE=
go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg=
go.opentelemetry.io/otel/sdk/log v0.6.0 h1:4J8BwXY4EeDE9Mowg+CyhWVBhTSLXVXodiXxS/+PGqI=
go.opentelemetry.io/otel/sdk/log v0.6.0/go.mod h1:L1DN8RMAduKkrwRAFDEX3E3TLOq46+XMGSbUfHU/+vE=
go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM=
go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y=
go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc=
go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
Expand Down Expand Up @@ -125,6 +156,10 @@ golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
4 changes: 2 additions & 2 deletions logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// GetProductionLogger creates and returns a new zap.Logger configured for production use.
// The production logger is optimized for performance. It uses a JSON encoder, logs to standard
// error, and writes at InfoLevel and above.
// error, and writes at InfoLevel and above as default.
//
// Returns:
//
Expand Down Expand Up @@ -57,6 +57,6 @@ func GetLogger(env string, level string) (*zap.Logger, error) {
case "production":
return GetProductionLogger(configLevel)
default:
return nil, fmt.Errorf("failure to construct logger for env: %s", env)
return nil, fmt.Errorf("not supported environment requested env: %s", env)
}
}
Loading

0 comments on commit 82db400

Please sign in to comment.