103 using std::stringstream;
107 ss.setf(std::ios::fixed, std:: ios::floatfield);
119 }
else if (
bytes < (1024 * 1024)) {
121 ss <<
bytes /
static_cast<float>(1024) <<
" KB";
123 }
else if (
bytes < (1024 * 1024 * 1024)) {
125 ss <<
bytes /
static_cast<float>(1024 * 1024) <<
" MB";
129 ss <<
bytes /
static_cast<float>(1024 * 1024 * 1024) <<
" GB";
std::string bytesToString(int64_t bytes)
Converts a byte count into a human-readable string.
size_t currentRSS()
Returns the current resident memory size.
Contains the Log class which can be used to redirect output to an arbitrary destination.
Contains logging-related functions.
Severity
Used by the Msg::print() call.
FIELD3D_API void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity.
FIELD3D_API void setVerbosity(int level=1)
Set the verbosity level of console output: 0 = do not echo anything to the console; >=1 = echo all me...
#define FIELD3D_NAMESPACE_SOURCE_CLOSE