summaryrefslogtreecommitdiffstats
path: root/otautil/include
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-04-16 00:24:24 +0200
committerxunchang <xunchang@google.com>2019-04-16 08:18:13 +0200
commit2239b9e4dd08e307ad74dc44b597fd53d2d17de8 (patch)
tree421f43033eb1998211e49134fd9e1cac4435efb6 /otautil/include
parentMerge "Move wipe cache|data to libinstall" (diff)
downloadandroid_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.tar
android_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.tar.gz
android_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.tar.bz2
android_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.tar.lz
android_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.tar.xz
android_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.tar.zst
android_bootable_recovery-2239b9e4dd08e307ad74dc44b597fd53d2d17de8.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