/*--------------------------------------------------------------------*//*! * \brief Write key-value-pair into log * \param log qpTestLog instance * \param name Unique identifier for entry * \param description Human readable description * \param tag Optional tag * \param value Value of the key-value-pair * \return true if ok, false otherwise *//*--------------------------------------------------------------------*/ deBool qpTestLog_writeFloat (qpTestLog* log, const char* name, const char* description, const char* unit, qpKeyValueTag tag, float value) { char tmpString[64]; floatToString(value, tmpString, sizeof(tmpString)); /* <Number Name="name" Description="description" Tag="Performance">15</Number> */ return qpTestLog_writeKeyValuePair(log, "Number", name, description, unit, tag, tmpString); }
/*--------------------------------------------------------------------*//*! * \brief Write key-value-pair into log * \param log qpTestLog instance * \param name Unique identifier for entry * \param description Human readable description * \param tag Optional tag * \param value Value of the key-value-pair * \return true if ok, false otherwise *//*--------------------------------------------------------------------*/ deBool qpTestLog_writeInteger (qpTestLog* log, const char* name, const char* description, const char* unit, qpKeyValueTag tag, deInt64 value) { char tmpString[64]; int64ToString(value, tmpString); /* <Number Name="name" Description="description" Tag="Performance">15</Number> */ return qpTestLog_writeKeyValuePair(log, "Number", name, description, unit, tag, tmpString); }
/*--------------------------------------------------------------------*//*! * \brief Write a message to output log * \param log qpTestLog instance * \param format Format string of message * \param ... Parameters for message * \return true if ok, false otherwise *//*--------------------------------------------------------------------*/ deBool qpTestLog_writeMessage (qpTestLog* log, const char* format, ...) { char buffer[1024]; va_list args; /* \todo [petri] Handle buffer overflows! */ va_start(args, format); buffer[DE_LENGTH_OF_ARRAY(buffer) - 1] = 0; vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); printf("%s\n", buffer); /* <Text>text</Text> */ return qpTestLog_writeKeyValuePair(log, "Text", DE_NULL, DE_NULL, DE_NULL, QP_KEY_TAG_LAST, buffer); }
/*--------------------------------------------------------------------*//*! * \brief Write key-value-pair into log * \param log qpTestLog instance * \param name Unique identifier for entry * \param description Human readable description * \param tag Optional tag * \param value Value of the key-value-pair * \return true if ok, false otherwise *//*--------------------------------------------------------------------*/ deBool qpTestLog_writeText (qpTestLog* log, const char* name, const char* description, qpKeyValueTag tag, const char* text) { /* <Text Name="name" Description="description" Tag="tag">text</Text> */ return qpTestLog_writeKeyValuePair(log, "Text", name, description, DE_NULL, tag, text); }