mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
universal7885: debug_daemon: run clang-format
Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
c4f1f10454
commit
7db5c03bac
3 changed files with 19 additions and 21 deletions
|
|
@ -19,26 +19,25 @@
|
||||||
#define WRITE_KMSG "/data/debug/logs/kmsg.txt"
|
#define WRITE_KMSG "/data/debug/logs/kmsg.txt"
|
||||||
#define LOG_TAG "DebugKmsgDaemon"
|
#define LOG_TAG "DebugKmsgDaemon"
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
bool check_data(){
|
bool check_data() {
|
||||||
std::ifstream datafile(CHECK_KMSG);
|
std::ifstream datafile(CHECK_KMSG);
|
||||||
if(datafile.good()){
|
if (datafile.good()) {
|
||||||
datafile.close();
|
datafile.close();
|
||||||
ALOGI("Found %s, logging...", CHECK_KMSG);
|
ALOGI("Found %s, logging...", CHECK_KMSG);
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
ALOGW("Couldn't find %s, not logging...", CHECK_KMSG);
|
ALOGW("Couldn't find %s, not logging...", CHECK_KMSG);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_kmsg(){
|
void copy_kmsg() {
|
||||||
if(check_data()){
|
if (check_data()) {
|
||||||
std::ifstream readfile(KMSG_PATH);
|
std::ifstream readfile(KMSG_PATH);
|
||||||
std::ofstream writefile(WRITE_KMSG);
|
std::ofstream writefile(WRITE_KMSG);
|
||||||
writefile << readfile.rdbuf();
|
writefile << readfile.rdbuf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,25 +18,24 @@
|
||||||
#define WRITE_LOGCAT "/data/debug/logs/logcat.txt"
|
#define WRITE_LOGCAT "/data/debug/logs/logcat.txt"
|
||||||
#define LOG_TAG "DebugLogcatDaemon"
|
#define LOG_TAG "DebugLogcatDaemon"
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
bool check_data(){
|
bool check_data() {
|
||||||
std::ifstream datafile(CHECK_LOGCAT);
|
std::ifstream datafile(CHECK_LOGCAT);
|
||||||
if(datafile.good()){
|
if (datafile.good()) {
|
||||||
datafile.close();
|
datafile.close();
|
||||||
ALOGI("Found %s, logging...", CHECK_LOGCAT);
|
ALOGI("Found %s, logging...", CHECK_LOGCAT);
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
ALOGW("Couldn't find %s, not logging...", CHECK_LOGCAT);
|
ALOGW("Couldn't find %s, not logging...", CHECK_LOGCAT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_logcat(){
|
void copy_logcat() {
|
||||||
if(check_data()){
|
if (check_data()) {
|
||||||
system("/system/bin/logcat -f /data/debug/logs/logcat.txt");
|
system("/system/bin/logcat -f /data/debug/logs/logcat.txt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
void copy_kmsg();
|
void copy_kmsg();
|
||||||
void copy_logcat();
|
void copy_logcat();
|
||||||
int main(){
|
int main() {
|
||||||
copy_kmsg();
|
copy_kmsg();
|
||||||
copy_logcat();
|
copy_logcat();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue