Skip to content

Commit

Permalink
Merge pull request #215 from halter-corp/feat/halter-release-v3.28.0-dev
Browse files Browse the repository at this point in the history
all: Reduce level for noisy logs
  • Loading branch information
HalterCru authored Jul 9, 2024
2 parents cc486d8 + cdb5c2b commit 6f4ee7b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/applicationserver/io/mqtt/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,6 @@ func (c *connection) deliver(pkt *packet.PublishPacket) {
"count", len(items.Downlinks),
)).Debug("Handle downlink messages")
if err := op(c.server, c.io.Context(), ids, items.Downlinks); err != nil {
logger.WithError(err).Warn("Failed to handle downlink messages")
logger.WithError(err).Info("Failed to handle downlink messages")
}
}
2 changes: 1 addition & 1 deletion pkg/applicationserver/io/pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (i *integration) handleDown(
"count", len(operation.Downlinks),
)).Debug("Handle downlink messages")
if err := op(i.server, ctx, operation.EndDeviceIds, operation.Downlinks); err != nil {
logger.WithError(err).Warn("Failed to handle downlink messages")
logger.WithError(err).Info("Failed to handle downlink messages")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/networkserver/downlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ func (ns *NetworkServer) attemptClassADataDownlink(ctx context.Context, dev *ttn
} else {
logger = logger.WithError(err)
}
logger.Warn("All Gateway Servers failed to schedule downlink, skip class A downlink slot")
logger.Info("All Gateway Servers failed to schedule downlink, skip class A downlink slot")
if genState.ApplicationDownlink != nil {
dev.Session.QueuedApplicationDownlinks = append([]*ttnpb.ApplicationDownlink{genState.ApplicationDownlink}, dev.Session.QueuedApplicationDownlinks...)
}
Expand Down Expand Up @@ -1788,7 +1788,7 @@ func (ns *NetworkServer) attemptNetworkInitiatedDataDownlink(ctx context.Context
}
}
}
logger.Warn("All Gateway Servers failed to schedule downlink, retry attempt")
logger.Info("All Gateway Servers failed to schedule downlink, retry attempt")
if genState.NeedsDownlinkQueueUpdate {
dev.Session.QueuedApplicationDownlinks = append([]*ttnpb.ApplicationDownlink{genState.ApplicationDownlink}, dev.Session.QueuedApplicationDownlinks...)
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/rpcmiddleware/rpclog/client_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func UnaryClientInterceptor(ctx context.Context, opts ...Option) grpc.UnaryClien
}

level := o.levelFunc(o.codeFunc(err))

// suppress logs
if level > log.InfoLevel {
level = log.InfoLevel
}
entry := logger.WithFields(onceFields)
if err != nil {
entry = entry.WithError(err)
Expand Down
4 changes: 4 additions & 0 deletions pkg/rpcmiddleware/rpclog/server_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func UnaryServerInterceptor(ctx context.Context, opts ...Option) grpc.UnaryServe
if err == context.Canceled {
level = log.InfoLevel
}
// suppress logs
if level > log.InfoLevel {
level = log.InfoLevel
}

entry := logger.WithFields(onceFields)
if err != nil {
Expand Down

0 comments on commit 6f4ee7b

Please sign in to comment.