diff --git a/steamcache/steamcache.go b/steamcache/steamcache.go index d89375e..2b78f45 100644 --- a/steamcache/steamcache.go +++ b/steamcache/steamcache.go @@ -111,11 +111,23 @@ func (sc *SteamCache) LogStats() { sc.mu.Lock() defer sc.mu.Unlock() if sc.dirty { + + logger.Logger.Info(). + Str("size", units.HumanSize(float64(sc.memory.Size()))). + Str("capacity", units.HumanSize(float64(sc.memory.Capacity()))). + Str("files", fmt.Sprintf("%d", len(sc.memory.StatAll()))). + Msg("memory") + + logger.Logger.Info(). + Str("size", units.HumanSize(float64(sc.disk.Size()))). + Str("capacity", units.HumanSize(float64(sc.disk.Capacity()))). + Str("files", fmt.Sprintf("%d", len(sc.disk.StatAll()))). + Msg("disk") + logger.Logger.Info(). - Str("memory", fmt.Sprintf("%s/%s", units.HumanSize(float64(sc.memory.Size())), units.HumanSize(float64(sc.memory.Capacity())))).Int("memory-files", len(sc.memory.StatAll())). - Str("disk", fmt.Sprintf("%s/%s", units.HumanSize(float64(sc.disk.Size())), units.HumanSize(float64(sc.disk.Capacity())))).Int("disk-files", len(sc.disk.StatAll())). Str("hitrate", fmt.Sprintf("%.2f%%", sc.hits.Avg()*100)). - Msg("stats") + Msg("cache") + sc.dirty = false } }