summaryrefslogtreecommitdiffstats
path: root/rotate_logs.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 21:25:03 +0200
commitcadf4ed45137fbb776584b4427694eb783183d7e (patch)
tree44898348b02504cd93a1c80911c3b0b11c0bd65d /rotate_logs.h
parentMerge changes I1cc5d702,I32ab9854 am: 420f7f8df4 (diff)
downloadandroid_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.tar
android_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.tar.gz
android_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.tar.bz2
android_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.tar.lz
android_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.tar.xz
android_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.tar.zst
android_bootable_recovery-cadf4ed45137fbb776584b4427694eb783183d7e.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