You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 lines
585 B

#include "logger.hpp"
#include <QApplication>
#include <QDateTime>
#include <QDebug>
#include <QFile>
void zos_log(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
char buf[1024] = {0};
vsnprintf(buf, sizeof(buf), fmt, args);
qInfo() << buf;
va_end(args);
}
int32_t zos_get_ticket() { return (int32_t)QDateTime::currentMSecsSinceEpoch(); }
std::string zhex2str(const uint8_t* hex, size_t len) {
std::string str;
for (size_t i = 0; i < len; i++) {
char buf[3] = {0};
snprintf(buf, sizeof(buf), "%02x ", hex[i]);
str += buf;
}
return str;
}