[Feature][T106]ZXW P56U09 code
Only Configure: Yes
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: No
Doc Update: No
Change-Id: I3cbd8b420271eb20c2b40ebe5c78f83059cd42f3
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..218ece1
--- /dev/null
+++ b/ap/lib/libupi_ab/inc/upi_log.h
@@ -0,0 +1,57 @@
+#ifndef UPI_LOG_H
+#define UPI_LOG_H
+
+
+extern FILE* s_FP_LOG;
+extern long cur_log_size;
+
+//#define FOTA_UPI_AB_LOG_ROOT "/cache/zte_fota_ab/"
+
+//#define FOTA_UPI_AB_LOG_PATH "/cache/zte_fota_ab/upi_ab.log"
+
+#define FOTA_LOG_PATH "fota_ab_log_path"
+
+
+#ifdef _IS_MIN
+
+
+#define upi_print(...) do { \
+ printf(__VA_ARGS__); \
+ } while(0)
+
+
+#else
+
+#define upi_print(...) do { \
+ printf(__VA_ARGS__); \
+ char buffer_log[512] = {0}; \
+ snprintf(buffer_log, 510, __VA_ARGS__); \
+ upi_fwrite(buffer_log); \
+ } while(0)
+
+
+#endif
+
+
+
+#define upi_log(fmt, args...) \
+ do {upi_print("[%s][fota_upi] [%s-%d]: " fmt"\n", upi_get_time_us(),__FUNCTION__, __LINE__, ## args);} while (0)
+#define upi_err(fmt, args...) \
+ do {upi_print("[%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* info);
+void upi_close_logfile(void);
+char * upi_get_time_us(void);
+
+unsigned int timestamp_now(void);
+
+#endif /*UPI_LOG_H*/