MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / printSingleArg

Function printSingleArg

runtime/Log.cc:1246–1273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1244 */
1245template<typename T>
1246static inline void
1247printSingleArg(FILE *outputFd,
1248 NanoLogInternal::Log::LogMessage &logArguments,
1249 const char* formatString,
1250 T arg,
1251 int width = -1,
1252 int precision = -1)
1253{
1254 logArguments.push(arg);
1255
1256 if (outputFd == nullptr)
1257 return;
1258
1259#pragma GCC diagnostic push
1260#pragma GCC diagnostic ignored "-Wformat-security"
1261#pragma GCC diagnostic ignored "-Wformat-nonliteral"
1262
1263 if (width < 0 && precision < 0) {
1264 fprintf(outputFd, formatString, arg);
1265 } else if (width >= 0 && precision < 0)
1266 fprintf(outputFd, formatString, width, arg);
1267 else if (width >= 0 && precision >= 0)
1268 fprintf(outputFd, formatString, width, precision, arg);
1269 else
1270 fprintf(outputFd, formatString, precision, arg);
1271
1272#pragma GCC diagnostic pop
1273}
1274
1275/**
1276 * Attempt to read back the next log statement contained in the BufferFragment,

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected