summaryrefslogtreecommitdiffstats
path: root/otautil/include/otautil/logging.h
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-04-16 00:24:24 +0200
committerTianjie Xu <xunchang@google.com>2019-04-16 21:26:44 +0200
commitcd780b456f2fcb108ccbe42d83cb8b03fb097513 (patch)
tree279c9dd2c473ab8f09df78e749d8b69f7729305a /otautil/include/otautil/logging.h
parentDO NOT MERGE: Move wipe cache|data to libinstall (diff)
downloadandroid_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.tar
android_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.tar.gz
android_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.tar.bz2
android_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.tar.lz
android_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.tar.xz
android_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.tar.zst
android_bootable_recovery-cd780b456f2fcb108ccbe42d83cb8b03fb097513.zip
Diffstat (limited to '')
-rw-r--r--otautil/include/otautil/logging.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/otautil/include/otautil/logging.h b/otautil/include/otautil/logging.h
index c4f13292b..608349785 100644
--- a/otautil/include/otautil/logging.h
+++ b/otautil/include/otautil/logging.h
@@ -18,9 +18,11 @@
#define _LOGGING_H
#include <stddef.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <string>
+#include <vector>
#include <log/log_id.h>
@@ -28,6 +30,14 @@ static constexpr int KEEP_LOG_COUNT = 10;
struct selabel_handle;
+struct saved_log_file {
+ std::string name;
+ struct stat sb;
+ std::string data;
+};
+
+void SetLoggingSehandle(selabel_handle* handle);
+
ssize_t logbasename(log_id_t id, char prio, const char* filename, const char* buf, size_t len,
void* arg);
@@ -48,4 +58,8 @@ void reset_tmplog_offset();
void save_kernel_log(const char* destination);
+std::vector<saved_log_file> ReadLogFilesToMemory();
+
+bool RestoreLogFilesAfterFormat(const std::vector<saved_log_file>& log_files);
+
#endif //_LOGGING_H