mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-19 22:44:18 +00:00
refactor: change remaining glog.Infof debug messages to V(3)
Changed remaining debug log messages with bracket prefixes from
glog.Infof() to glog.V(3).Infof() to prevent them from showing
in production logs by default.
Changes (8 messages across 3 files):
- glog.Infof("[") -> glog.V(3).Infof("[")
Files updated:
- weed/mq/broker/broker_grpc_fetch.go (4 messages)
- [FetchMessage] CALLED! debug marker
- [FetchMessage] request details
- [FetchMessage] LogBuffer read start
- [FetchMessage] LogBuffer read completion
- weed/mq/kafka/integration/broker_client_fetch.go (3 messages)
- [FETCH-STATELESS-CLIENT] received messages
- [FETCH-STATELESS-CLIENT] converted records (with data)
- [FETCH-STATELESS-CLIENT] converted records (empty)
- weed/mq/kafka/integration/broker_client_publish.go (1 message)
- [GATEWAY RECV] _schemas topic debug
Now ALL debug messages with bracket prefixes require -v=3 or higher:
- Default (-v=0): Clean production logs ✅
- -v=3: All debug messages visible
- -v=4: All verbose debug messages visible
Result: Production logs are now clean with default settings!
This commit is contained in:
@@ -25,7 +25,7 @@ import (
|
||||
// - No shared state between requests
|
||||
// - Natural support for concurrent reads
|
||||
func (b *MessageQueueBroker) FetchMessage(ctx context.Context, req *mq_pb.FetchMessageRequest) (*mq_pb.FetchMessageResponse, error) {
|
||||
glog.Infof("[FetchMessage] CALLED!") // DEBUG: ensure this shows up
|
||||
glog.V(3).Infof("[FetchMessage] CALLED!") // DEBUG: ensure this shows up
|
||||
|
||||
// Validate request
|
||||
if req.Topic == nil {
|
||||
@@ -38,7 +38,7 @@ func (b *MessageQueueBroker) FetchMessage(ctx context.Context, req *mq_pb.FetchM
|
||||
t := topic.FromPbTopic(req.Topic)
|
||||
partition := topic.FromPbPartition(req.Partition)
|
||||
|
||||
glog.Infof("[FetchMessage] %s/%s partition=%v offset=%d maxMessages=%d maxBytes=%d consumer=%s/%s",
|
||||
glog.V(3).Infof("[FetchMessage] %s/%s partition=%v offset=%d maxMessages=%d maxBytes=%d consumer=%s/%s",
|
||||
t.Namespace, t.Name, partition, req.StartOffset, req.MaxMessages, req.MaxBytes,
|
||||
req.ConsumerGroup, req.ConsumerId)
|
||||
|
||||
@@ -105,14 +105,14 @@ func (b *MessageQueueBroker) FetchMessage(ctx context.Context, req *mq_pb.FetchM
|
||||
requestedOffset := req.StartOffset
|
||||
|
||||
// Read messages from LogBuffer (stateless read)
|
||||
glog.Infof("[FetchMessage] About to read from LogBuffer at offset %d (requested=%d)", requestedOffset, req.StartOffset)
|
||||
glog.V(3).Infof("[FetchMessage] About to read from LogBuffer at offset %d (requested=%d)", requestedOffset, req.StartOffset)
|
||||
logEntries, nextOffset, highWaterMark, endOfPartition, err := localPartition.LogBuffer.ReadMessagesAtOffset(
|
||||
requestedOffset,
|
||||
maxMessages,
|
||||
maxBytes,
|
||||
)
|
||||
|
||||
glog.Infof("[FetchMessage] Read completed: %d entries, nextOffset=%d, hwm=%d, eop=%v, err=%v",
|
||||
glog.V(3).Infof("[FetchMessage] Read completed: %d entries, nextOffset=%d, hwm=%d, eop=%v, err=%v",
|
||||
len(logEntries), nextOffset, highWaterMark, endOfPartition, err)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -80,7 +80,7 @@ func (bc *BrokerClient) FetchMessagesStateless(ctx context.Context, topic string
|
||||
}
|
||||
}
|
||||
|
||||
glog.Infof("[FETCH-STATELESS-CLIENT] Received %d messages from broker, nextOffset=%d, hwm=%d",
|
||||
glog.V(3).Infof("[FETCH-STATELESS-CLIENT] Received %d messages from broker, nextOffset=%d, hwm=%d",
|
||||
len(resp.Messages), resp.NextOffset, resp.HighWaterMark)
|
||||
|
||||
// Convert protobuf messages to SeaweedRecord
|
||||
@@ -96,10 +96,10 @@ func (bc *BrokerClient) FetchMessagesStateless(ctx context.Context, topic string
|
||||
}
|
||||
|
||||
if len(records) > 0 {
|
||||
glog.Infof("[FETCH-STATELESS-CLIENT] Converted to %d SeaweedRecords, first offset=%d, last offset=%d",
|
||||
glog.V(3).Infof("[FETCH-STATELESS-CLIENT] Converted to %d SeaweedRecords, first offset=%d, last offset=%d",
|
||||
len(records), records[0].Offset, records[len(records)-1].Offset)
|
||||
} else {
|
||||
glog.Infof("[FETCH-STATELESS-CLIENT] Converted to 0 SeaweedRecords")
|
||||
glog.V(3).Infof("[FETCH-STATELESS-CLIENT] Converted to 0 SeaweedRecords")
|
||||
}
|
||||
|
||||
glog.V(4).Infof("[FETCH-STATELESS] Fetched %d records, nextOffset=%d, highWaterMark=%d, endOfPartition=%v",
|
||||
|
||||
@@ -62,7 +62,7 @@ func (bc *BrokerClient) PublishRecord(ctx context.Context, topic string, partiti
|
||||
}
|
||||
|
||||
if topic == "_schemas" {
|
||||
glog.Infof("[GATEWAY RECV] topic=%s partition=%d resp.AssignedOffset=%d resp.AckTsNs=%d",
|
||||
glog.V(3).Infof("[GATEWAY RECV] topic=%s partition=%d resp.AssignedOffset=%d resp.AckTsNs=%d",
|
||||
topic, partition, resp.AssignedOffset, resp.AckTsNs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user