summaryrefslogtreecommitdiffstats
path: root/logging.h
diff options
context:
space:
mode:
authorJerry Zhang <zhangjerry@google.com>2018-05-03 01:56:00 +0200
committerJerry Zhang <zhangjerry@google.com>2018-05-07 23:14:17 +0200
commit152933a28e9afd9d696f5b0284e638894e6492ee (patch)
tree5cb7ba653a1a16dd2b603cc66a3da75c59e0ef1b /logging.h
parentMerge changes I1cc5d702,I32ab9854 (diff)
downloadandroid_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.tar
android_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.tar.gz
android_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.tar.bz2
android_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.tar.lz
android_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.tar.xz
android_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.tar.zst
android_bootable_recovery-152933a28e9afd9d696f5b0284e638894e6492ee.zip
Diffstat (limited to '')
-rw-r--r--logging.h (renamed from rotate_logs.h)18
1 files changed, 15 insertions, 3 deletions
diff --git a/rotate_logs.h b/logging.h
index 007c33d44..3cfbc7af6 100644
--- a/rotate_logs.h
+++ b/logging.h
@@ -14,12 +14,14 @@
* limitations under the License.
*/
-#ifndef _ROTATE_LOGS_H
-#define _ROTATE_LOGS_H
+#ifndef _LOGGING_H
+#define _LOGGING_H
#include <stddef.h>
#include <sys/types.h>
+#include <string>
+
#include <log/log_id.h>
static constexpr int KEEP_LOG_COUNT = 10;
@@ -35,4 +37,14 @@ ssize_t logrotate(log_id_t id, char prio, const char* filename, const char* buf,
// Overwrite any existing last_log.$max and last_kmsg.$max.
void rotate_logs(const char* last_log_file, const char* last_kmsg_file);
-#endif //_ROTATE_LOG_H
+// In turn fflush(3)'s, fsync(3)'s and fclose(3)'s the given stream.
+void check_and_fclose(FILE* fp, const std::string& name);
+
+void copy_log_file_to_pmsg(const std::string& source, const std::string& destination);
+void copy_log_file(const std::string& source, const std::string& destination, bool append);
+void copy_logs(bool modified_flash, bool has_cache);
+void reset_tmplog_offset();
+
+void save_kernel_log(const char* destination);
+
+#endif //_LOGGING_H