| 1244 | */ |
| 1245 | template<typename T> |
| 1246 | static inline void |
| 1247 | printSingleArg(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, |
no test coverage detected