Skip to content

Commit c4f8b99

Browse files
committed
cleanup log messages
1 parent 805f16b commit c4f8b99

File tree

1 file changed

+2
-87
lines changed

1 file changed

+2
-87
lines changed

internal/maintnotifications/logs/log_messages.go

Lines changed: 2 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ const (
7575
HandoffQueueFullMessage = "handoff queue is full"
7676
FailedToDialNewEndpointMessage = "failed to dial new endpoint"
7777
ApplyingRelaxedTimeoutDueToPostHandoffMessage = "applying relaxed timeout due to post-handoff"
78-
SetNetConnAndInitConnTimingMessage = "SetNetConnAndInitConn took"
7978
HandoffSuccessMessage = "handoff succeeded"
8079
RemovingConnectionFromPoolMessage = "removing connection from pool"
8180
NoPoolProvidedMessageCannotRemoveMessage = "no pool provided, cannot remove connection, closing it"
@@ -112,7 +111,6 @@ const (
112111
// ========================================
113112
InvalidNotificationFormatMessage = "invalid notification format"
114113
InvalidNotificationTypeFormatMessage = "invalid notification type format"
115-
InvalidNotificationMessage = "invalid notification"
116114
InvalidSeqIDInMovingNotificationMessage = "invalid seqID in MOVING notification"
117115
InvalidTimeSInMovingNotificationMessage = "invalid timeS in MOVING notification"
118116
InvalidNewEndpointInMovingNotificationMessage = "invalid newEndpoint in MOVING notification"
@@ -125,15 +123,9 @@ const (
125123
FailedToMarkForHandoffMessage = "failed to mark connection for handoff"
126124

127125
// ========================================
128-
// UNUSED CONSTANTS - Not currently used in codebase
126+
// used in pool/conn
129127
// ========================================
130-
UnrelaxedTimeoutAfterDeadlineMessage = "clearing relaxed timeout after deadline"
131-
FailedToMarkQueuedForHandoffMessage = "failed to mark connection as queued for handoff"
132-
ConnectionAlreadyMarkedForHandoffMessage = "already marked for handoff"
133-
CircuitBreakerHalfOpenMessage = "circuit breaker is half-open, testing if endpoint recovered"
134-
FailingDueToCircuitBreakerMessage = "failing due to circuit breaker"
135-
ShuttingDownMessage = "shutting down"
136-
ConnectionInInvalidStateForHandoffMessage = "connection is in invalid state for handoff"
128+
UnrelaxedTimeoutAfterDeadlineMessage = "clearing relaxed timeout after deadline"
137129
)
138130

139131
func HandoffStarted(connID uint64, newEndpoint string) string {
@@ -212,21 +204,6 @@ func FailedToMarkForHandoff(connID uint64, err error) string {
212204
return fmt.Sprintf("conn[%d] %s: %v %s", connID, FailedToMarkForHandoffMessage, err, string(data))
213205
}
214206

215-
func FailedToMarkQueuedForHandoff(connID uint64, err error) string {
216-
data, _ := json.Marshal(map[string]interface{}{
217-
"connID": connID,
218-
"error": err.Error(),
219-
})
220-
return fmt.Sprintf("conn[%d] %s: %v %s", connID, FailedToMarkQueuedForHandoffMessage, err, string(data))
221-
}
222-
223-
func ConnectionAlreadyMarkedForHandoff(connID uint64) string {
224-
data, _ := json.Marshal(map[string]interface{}{
225-
"connID": connID,
226-
})
227-
return fmt.Sprintf("conn[%d] %s %s", connID, ConnectionAlreadyMarkedForHandoffMessage, string(data))
228-
}
229-
230207
func FailedToDialNewEndpoint(connID uint64, endpoint string, err error) string {
231208
data, _ := json.Marshal(map[string]interface{}{
232209
"connID": connID,
@@ -335,38 +312,7 @@ func CircuitBreakerOpen(connID uint64, endpoint string) string {
335312
return fmt.Sprintf("conn[%d] %s for %s %s", connID, CircuitBreakerOpenMessage, endpoint, string(data))
336313
}
337314

338-
func CircuitBreakerHalfOpen(endpoint string) string {
339-
data, _ := json.Marshal(map[string]interface{}{
340-
"endpoint": endpoint,
341-
})
342-
return fmt.Sprintf("%s for %s %s", CircuitBreakerHalfOpenMessage, endpoint, string(data))
343-
}
344-
345-
func FailingDueToCircuitBreaker(connID uint64, endpoint string) string {
346-
data, _ := json.Marshal(map[string]interface{}{
347-
"connID": connID,
348-
"endpoint": endpoint,
349-
})
350-
return fmt.Sprintf("conn[%d] %s for %s %s", connID, FailingDueToCircuitBreakerMessage, endpoint, string(data))
351-
}
352-
353-
// System functions
354-
func ShuttingDown() string {
355-
data, _ := json.Marshal(map[string]interface{}{})
356-
return fmt.Sprintf("%s %s", ShuttingDownMessage, string(data))
357-
}
358-
359-
// Connection state functions
360-
func ConnectionInInvalidStateForHandoff(connID uint64, state string) string {
361-
data, _ := json.Marshal(map[string]interface{}{
362-
"connID": connID,
363-
"state": state,
364-
})
365-
return fmt.Sprintf("conn[%d] %s (state: %s) %s", connID, ConnectionInInvalidStateForHandoffMessage, state, string(data))
366-
}
367-
368315
// Additional handoff functions for specific cases
369-
370316
func ConnectionNotMarkedForHandoff(connID uint64) string {
371317
data, _ := json.Marshal(map[string]interface{}{
372318
"connID": connID,
@@ -476,33 +422,11 @@ func FailedToRegisterHandler(notificationType string, err error) string {
476422
return fmt.Sprintf("%s for %s: %v %s", FailedToRegisterHandlerMessage, notificationType, err, string(data))
477423
}
478424

479-
func ConnectionMarkedForHandoffError(connID uint64) string {
480-
data, _ := json.Marshal(map[string]interface{}{
481-
"connID": connID,
482-
})
483-
return fmt.Sprintf("%s %s", ConnectionMarkedForHandoffErrorMessage, string(data))
484-
}
485-
486-
func ConnectionInvalidHandoffStateError(connID uint64, state string) string {
487-
data, _ := json.Marshal(map[string]interface{}{
488-
"connID": connID,
489-
"state": state,
490-
})
491-
return fmt.Sprintf("%s: %s %s", ConnectionInvalidHandoffStateErrorMessage, state, string(data))
492-
}
493-
494425
func ShutdownError() string {
495426
data, _ := json.Marshal(map[string]interface{}{})
496427
return fmt.Sprintf("%s %s", ShutdownErrorMessage, string(data))
497428
}
498429

499-
func CircuitBreakerOpenError(endpoint string) string {
500-
data, _ := json.Marshal(map[string]interface{}{
501-
"endpoint": endpoint,
502-
})
503-
return fmt.Sprintf("%s for %s %s", CircuitBreakerOpenErrorMessage, endpoint, string(data))
504-
}
505-
506430
// Configuration validation error functions
507431
func InvalidRelaxedTimeoutError() string {
508432
data, _ := json.Marshal(map[string]interface{}{})
@@ -617,15 +541,6 @@ func WorkerExitingDueToInactivityTimeout(timeout interface{}) string {
617541
return fmt.Sprintf("%s (%v) %s", WorkerExitingDueToInactivityTimeoutMessage, timeout, string(data))
618542
}
619543

620-
func SetNetConnAndInitConnTiming(connID uint64, duration interface{}, err error) string {
621-
data, _ := json.Marshal(map[string]interface{}{
622-
"connID": connID,
623-
"duration": fmt.Sprintf("%v", duration),
624-
"error": err.Error(),
625-
})
626-
return fmt.Sprintf("conn[%d] %s %v: err: %v %s", connID, SetNetConnAndInitConnTimingMessage, duration, err, string(data))
627-
}
628-
629544
func ApplyingRelaxedTimeoutDueToPostHandoff(connID uint64, timeout interface{}, until string) string {
630545
data, _ := json.Marshal(map[string]interface{}{
631546
"connID": connID,

0 commit comments

Comments
 (0)