Fixed small formatting errors of log output

- removed trailing ","s
- removed unecessary space before seconds
This commit is contained in:
Cecylia Bocovich 2019-06-14 17:09:06 -04:00
parent 0767a637c1
commit f779013b2d
2 changed files with 14 additions and 8 deletions

View file

@ -74,6 +74,12 @@ func (s CountryStats) Display() string {
for cc, count := range s.counts {
output += fmt.Sprintf("%s=%d,", cc, count)
}
// cut off trailing ","
if len(output) > 0 {
return output[:len(output)-1]
}
return output
}
@ -163,7 +169,7 @@ func (m *Metrics) logMetrics() {
}
func (m *Metrics) printMetrics() {
m.logger.Println("snowflake-stats-end", time.Now().UTC().Format("2006-01-02 15:04:05"), "(", int(metricsResolution.Seconds()), "s)")
m.logger.Println("snowflake-stats-end", time.Now().UTC().Format("2006-01-02 15:04:05"), fmt.Sprintf("(%d s)", int(metricsResolution.Seconds())))
m.logger.Println("snowflake-ips", m.countryStats.Display())
m.logger.Println("snowflake-idle-count", binCount(m.proxyIdleCount))
m.logger.Println("client-denied-count", binCount(m.clientDeniedCount))