All logs to LOGS directory (#973)

* Added #define LOG_ROOT_DIR
* using LOG_ROOT_DIR as root path of log
This commit is contained in:
gullradriel 2023-05-11 21:56:24 +02:00 committed by GitHub
parent 1edd3716a1
commit 69927e3c2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 24 additions and 11 deletions

View file

@ -117,6 +117,8 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
std::unique_ptr<ADSBLogger> logger { };
make_new_directory(LOG_ROOT_DIR);
icao_code = to_string_hex(entry_copy.ICAO_address, 6);
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
@ -351,7 +353,7 @@ void ADSBRxView::sort_entries_by_state()
}
void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
logger = std::make_unique<ADSBLogger>();
logger = std::make_unique<ADSBLogger>();
rtc::RTC datetime;
std::string callsign;
std::string str_info;
@ -422,6 +424,7 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
} else if(msg_type == AIRBORNE_VEL && msg_sub >= VEL_GND_SUBSONIC && msg_sub <= VEL_AIR_SUPERSONIC){
entry.set_frame_velo(frame);
if (logger) {
logger->append( LOG_ROOT_DIR "/ADSB.TXT" );
logentry += "Type:" + to_string_dec_uint(msg_sub) +
" Hdg:" + to_string_dec_uint(entry.velo.heading) +
" Spd: "+ to_string_dec_int(entry.velo.speed);
@ -432,7 +435,7 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
} // frame.get_DF() == DF_ADSB
if (logger) {
logger->append(u"adsb.txt");
logger->append( LOG_ROOT_DIR "/ADSB.TXT" );
// will log each frame in format:
// 20171103100227 8DADBEEFDEADBEEFDEADBEEFDEADBEEF ICAO:nnnnnn callsign Alt:nnnnnn Latnnn.nn Lonnnn.nn
logger->log_str(logentry);