[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/lib/libupi_ab/inc/upi_log.h b/ap/lib/libupi_ab/inc/upi_log.h
new file mode 100755
index 0000000..d089723
--- /dev/null
+++ b/ap/lib/libupi_ab/inc/upi_log.h
@@ -0,0 +1,53 @@
+#ifndef UPI_LOG_H
+#define UPI_LOG_H
+
+
+#define  	FOTA_UPI_AB_LOG_ROOT										"/cache/zte_fota_ab/"
+
+#define  	FOTA_UPI_AB_LOG_PATH										"/cache/zte_fota_ab/upi_ab.log"
+
+
+#ifdef _IS_MIN
+
+
+#define upi_print(ModID,...) do { \
+							printf(__VA_ARGS__); \
+						} while(0)
+
+
+#else
+
+#define upi_print(ModID,...) do { \
+							printf(__VA_ARGS__); \
+							char buffer_log[512] = {0}; \
+							snprintf(buffer_log, 510, __VA_ARGS__); \
+							upi_fwrite(ModID,buffer_log); \
+						} while(0)
+
+
+#endif
+
+
+
+#define  upi_log(fmt, args...) \
+ 	do {upi_print(FOTA_UPI_AB_LOG_PATH,  "[%s][fota_upi] [%s-%d]: " fmt"\n", upi_get_time_us(),__FUNCTION__, __LINE__, ## args);} while (0)
+#define  upi_err(fmt, args...)   \
+	do {upi_print(FOTA_UPI_AB_LOG_PATH,  "[%s][fota_upi] [%s-%d]: " fmt"\n", upi_get_time_us(),__FUNCTION__, __LINE__, ## args);} while (0)
+#if 0
+#define  lib_log(fmt, args...)   \
+	do {upi_print(FOTA_UPI_AB_LOG_PATH,  "" fmt"\n",  ## args);} while (0)
+#endif
+
+
+#define LOG_FUNC_BEGIN		upi_log("%s func begin!", __func__);
+#define LOG_FUNC_END		upi_log("%s func end!", __func__);
+
+
+
+void  upi_fwrite(char *filename, char* info);
+void upi_close_logfile(void);
+char * upi_get_time_us(void);
+
+unsigned int timestamp_now(void);
+
+#endif /*UPI_LOG_H*/