Skip to content
Permalink
Browse files

Update logs to reudce verbosity and consistency

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
  • Loading branch information
viveksyngh authored and alexellis committed Jan 24, 2020
1 parent 6c1784e commit 9fd8a59b89071e35a361204ecb4a8326d80976e4
Showing with 5 additions and 5 deletions.
  1. +1 −1 gateway/handlers/notifiers.go
  2. +1 −1 gateway/handlers/scaling.go
  3. +1 −1 gateway/scaling/function_scaler.go
  4. +2 −2 watchdog/handler.go
@@ -85,5 +85,5 @@ type LoggingNotifier struct {

// Notify a log about a request
func (LoggingNotifier) Notify(method string, URL string, originalURL string, statusCode int, duration time.Duration) {
log.Printf("Forwarded [%s] to %s - [%d] - %f seconds", method, originalURL, statusCode, duration.Seconds())
log.Printf("Forwarded [%s] to %s - [%d] - %fs", method, originalURL, statusCode, duration.Seconds())
}
@@ -57,6 +57,6 @@ func MakeScalingHandler(next http.HandlerFunc, config scaling.ScalingConfig, def
return
}

log.Printf("[Scale] function=%s.%s 0=>N timed-out after %f seconds\n", functionName, namespace, res.Duration.Seconds())
log.Printf("[Scale] function=%s.%s 0=>N timed-out after %fs\n", functionName, namespace, res.Duration.Seconds())
}
}
@@ -117,7 +117,7 @@ func (f *FunctionScaler) Scale(functionName, namespace string) FunctionScaleResu

if queryResponse.AvailableReplicas > 0 {

log.Printf("[Scale] function=%s 0 => %d successful - %f seconds",
log.Printf("[Scale] function=%s 0 => %d successful - %fs",
functionName, queryResponse.AvailableReplicas, totalTime.Seconds())

return FunctionScaleResult{
@@ -215,9 +215,9 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
}

if len(bytesWritten) > 0 {
log.Printf("%s - Duration: %f seconds", bytesWritten, execDuration)
log.Printf("%s - Duration: %fs", bytesWritten, execDuration)
} else {
log.Printf("Duration: %f seconds", execDuration)
log.Printf("Duration: %fs", execDuration)
}
}

0 comments on commit 9fd8a59

Please sign in to comment.
You can’t perform that action at this time.