From 5518b11720b5048c0c0b0668199d067c1056685e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 20 Oct 2020 12:38:46 +0300 Subject: [PATCH] lib/memory: do not print trailing zeroes in logs for `-memory.allowedPercent` command-line flag --- lib/memory/memory.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/memory/memory.go b/lib/memory/memory.go index aeab21812..fc225f596 100644 --- a/lib/memory/memory.go +++ b/lib/memory/memory.go @@ -35,12 +35,12 @@ func initOnce() { mem := sysTotalMemory() if allowedBytes.N <= 0 { if *allowedPercent < 1 || *allowedPercent > 200 { - logger.Panicf("FATAL: -memory.allowedPercent must be in the range [1...200]; got %f", *allowedPercent) + logger.Panicf("FATAL: -memory.allowedPercent must be in the range [1...200]; got %g", *allowedPercent) } percent := *allowedPercent / 100 allowedMemory = int(float64(mem) * percent) remainingMemory = mem - allowedMemory - logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedPercent=%f", allowedMemory, remainingMemory, *allowedPercent) + logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedPercent=%g", allowedMemory, remainingMemory, *allowedPercent) } else { allowedMemory = allowedBytes.N remainingMemory = mem - allowedMemory