Skip to content

Commit

Permalink
3 minor fixes
Browse files Browse the repository at this point in the history
fix tbsk typo in p25_parser.cc

remove duplicate include line in p25_frame_assembler_impl.cc

remove duplicate add_file_log line in main.cc/have it capture log file config lines (fixes robotastic#754)
  • Loading branch information
rosecitytransit committed May 21, 2023
1 parent 87e15a0 commit 8f61757
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion lib/op25_repeater/lib/p25_frame_assembler_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <vector>
#include <sys/time.h>

Expand Down
15 changes: 4 additions & 11 deletions trunk-recorder/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ bool load_config(string config_file) {
BOOST_LOG_TRIVIAL(info) << "After you have made these updates, make sure you add \"ver\": 2, to the top.\n\n";
return false;
}

config.log_file = pt.get<bool>("logFile", false);
BOOST_LOG_TRIVIAL(info) << "Log to File: " << config.log_file;
config.log_dir = pt.get<std::string>("logDir", "logs");
BOOST_LOG_TRIVIAL(info) << "Log Directory: " << config.log_dir;
if (config.log_file) {
logging::add_file_log(
keywords::file_name = config.log_dir + "/%m-%d-%Y_%H%M_%2N.log",
Expand All @@ -163,6 +162,9 @@ bool load_config(string config_file) {
keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
keywords::auto_flush = true);
}
BOOST_LOG_TRIVIAL(info) << "Log to File: " << config.log_file;
BOOST_LOG_TRIVIAL(info) << "Log Directory: " << config.log_dir;

BOOST_LOG_TRIVIAL(info) << "\n-------------------------------------\n Trunk Recorder\n-------------------------------------\n";

BOOST_LOG_TRIVIAL(info) << "\n\n-------------------------------------\nINSTANCE\n-------------------------------------\n";
Expand Down Expand Up @@ -1756,15 +1758,6 @@ int main(int argc, char **argv) {

start_plugins(sources, systems);

if (config.log_file) {
logging::add_file_log(
keywords::file_name = config.log_dir + "/%m-%d-%Y_%H%M_%2N.log",
keywords::format = "[%TimeStamp%] (%Severity%) %Message%",
keywords::rotation_size = 100 * 1024 * 1024,
keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
keywords::auto_flush = true);
}

if (setup_systems()) {
signal(SIGINT, exit_interupt);
tb->unlock();
Expand Down
2 changes: 1 addition & 1 deletion trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
message.tdma_slot = 0;
}

os << "tbsk02\tMoto Patch Grant\tChannel ID: " << std::setw(5) << ch << "\tFreq: " << format_freq(f) << "\tsg " << std::setw(7) << sg << "\tTDMA " << get_tdma_slot(ch, sys_num) << "\tsa " << sa;
os << "tsbk02\tMoto Patch Grant\tChannel ID: " << std::setw(5) << ch << "\tFreq: " << format_freq(f) << "\tsg " << std::setw(7) << sg << "\tTDMA " << get_tdma_slot(ch, sys_num) << "\tsa " << sa;
message.meta = os.str();
BOOST_LOG_TRIVIAL(debug) << os.str();
} else {
Expand Down

0 comments on commit 8f61757

Please sign in to comment.