CatapultServer  v0.5.0.1 (Elephant)
CacheSizeLogger.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include <stdint.h>
23 
24 namespace catapult { namespace cache {
25 
27  inline void LogSizes(const char* name, size_t actual, uint64_t max) {
28  auto logCacheSizeIf = [name, actual](uint64_t desired, const char* description) {
29  if (actual != desired)
30  return;
31 
32  CATAPULT_LOG(warning) << name << " cache is " << description << " (size = " << actual << ")";
33  };
34 
35  // log if cache is filling up (or full)
36  logCacheSizeIf(max / 2, "half full");
37  logCacheSizeIf(max, "full");
38  }
39 }}
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
colorPrint.warning
def warning(*args)
Definition: colorPrint.py:10
catapult::cache::LogSizes
void LogSizes(const char *name, size_t actual, uint64_t max)
Logs cache sizes for a cache with name at specified levels of fullness given its actual and max sizes...
Definition: CacheSizeLogger.h:27
catapult
Definition: AddressExtractionExtension.cpp:28