log: print ISO date instead of timestamp
This commit is contained in:
		| @@ -92,9 +92,12 @@ static void tic2mqtt_process_group(const char *tag, const char *data, time_t dat | |||||||
|         strncpy(ptag_desc->data, data, ptag_desc->len); |         strncpy(ptag_desc->data, data, ptag_desc->len); | ||||||
|  |  | ||||||
|         char topic[TOPIC_MAXLEN + 1]; |         char topic[TOPIC_MAXLEN + 1]; | ||||||
|  |         char stamp_str[32]; | ||||||
|  |  | ||||||
|         snprintf(topic, TOPIC_MAXLEN, "tic2mqtt/%s/%s", tic_name, tag); |         snprintf(topic, TOPIC_MAXLEN, "tic2mqtt/%s/%s", tic_name, tag); | ||||||
|  |  | ||||||
|         log_info("%ld %s %s\n", stamp, topic, data); |         strftime(stamp_str, 32, "%Y-%m-%d %H:%M:%S", localtime(&stamp)); | ||||||
|  |         log_info("%s %s %s\n", stamp_str, topic, data); | ||||||
|  |  | ||||||
|         if (mosq_tic) { |         if (mosq_tic) { | ||||||
|           int res = mqtt_publish(mosq_tic, topic, NULL, data, TIC_QOS); |           int res = mqtt_publish(mosq_tic, topic, NULL, data, TIC_QOS); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user