--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TT_DAEMON_DIAG_H__
+#define __TT_DAEMON_DIAG_H__
+
+char *ttd_diag_collect_log_to_zip(void);
+
+#endif /* __TT_DAEMON_DIAG_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <glib.h>
+#include <glib/gstdio.h>
+#include <stdio.h>
+#include <tzplatform_config.h>
+#include "ttd-log.h"
+#include "common-util.h"
+#include "ttd-zip.h"
+#include "ttd-diag.h"
+
+struct _ttd_diag_info_s {
+ char *log_file;
+ char *file_hash;
+};
+
+char *ttd_diag_collect_log_to_zip(void)
+{
+ const char *zip_name = NULL;
+ char *tmp_name = NULL;
+ ttd_zip *zip = NULL;
+
+ /* TODO : The ID should be changed to TZ_SYS_TMP, after tizen config is ready */
+ enum tzplatform_variable id = TZ_SYS_VAR;
+
+ tmp_name = g_strdup_printf("log-%lld.zip", common_get_epoch_coarse_time());
+ retv_if(!tmp_name, NULL);
+
+ zip_name = tzplatform_mkpath(id, tmp_name);
+ g_free(tmp_name);
+ tmp_name = NULL;
+ retv_if(!zip_name, NULL);
+
+ zip = ttd_zip_open(zip_name);
+ retv_if(!zip, NULL);
+
+ /* TODO : get list of log files */
+ ttd_zip_append_file(zip, "/opt/var/log/ttd.log", "ttd.log");
+ ttd_zip_append_file(zip, "/opt/var/log/dlog", "dlog");
+
+ ttd_zip_close(zip);
+
+ return g_strdup(zip_name);
+}