/* client list */
static GSList* g_client_list = NULL;
+#ifdef ENABLE_FILE_LOG
+static void file_log(const char* s)
+{
+ FILE *fp = fopen("/tmp/maservice_log.txt", "a");
+ if (fp) {
+ char time_buf[96] = {0};
+
+ struct timespec ts;
+ clock_gettime(CLOCK_REALTIME, &ts);
+ const time_t tt = ts.tv_sec;
+ struct tm *const ptm = localtime(&tt);
+
+ strftime(time_buf, sizeof(time_buf), "%m-%d %H:%M:%S", ptm);
+ fprintf(fp, "[%s] %s\n", time_buf, s);
+ fclose(fp);
+ }
+ fflush(fp);
+}
+#endif
+
int ma_client_create(ma_client_s *info)
{
if (NULL == info) {
bool service_app_create(void *data)
{
// Todo: add your code here.
-
- MAS_LOGD("[Enter] Service app create");
+ MAS_LOGI("[ENTER] Service app create");
+#ifdef ENABLE_FILE_LOG
+ file_log("[ENTER] Service app create");
+#endif
if (0 != init_wakeup()) {
MAS_LOGE("Fail to init wakeup service");
}
}
+#ifdef ENABLE_FILE_LOG
+ file_log("[END] Service app create");
+#endif
+ MAS_LOGI("[END] Service app create");
return true;
}
int main(int argc, char* argv[])
{
+ LOGI("Main function starts");
+#ifdef ENABLE_FILE_LOG
+ file_log("Main function starts");
+#endif
+
char ad[50] = {0,};
service_app_lifecycle_callback_s event_callback;
app_event_handler_h handlers[5] = {NULL, };