change logging

This commit is contained in:
Bastian Bloessl
2023-08-04 13:09:57 +02:00
parent 965e2d474f
commit abed50bf7f
6 changed files with 13 additions and 14 deletions
+4 -3
View File
@@ -21,7 +21,6 @@
#include <gnuradio/io_signature.h>
#include <boost/crc.hpp>
#include <boost/format.hpp>
#include <iomanip>
using namespace gr::ieee802_11;
@@ -147,8 +146,10 @@ public:
return;
}
mylog(boost::format("encoding: %1% - length: %2% - symbols: %3%") %
d_ofdm.encoding % d_frame.psdu_size % d_frame.n_sym);
mylog("encoding: {} - length: {} - symbols: {}",
d_ofdm.encoding,
d_frame.psdu_size,
d_frame.n_sym);
// create PDU
pmt::pmt_t blob = pmt::make_blob(out_bytes + 2, d_frame.psdu_size - 4);
+4 -3
View File
@@ -23,7 +23,6 @@
#include "frame_equalizer_impl.h"
#include "utils.h"
#include <gnuradio/io_signature.h>
#include <boost/format.hpp>
namespace gr {
namespace ieee802_11 {
@@ -360,8 +359,10 @@ bool frame_equalizer_impl::parse_signal(uint8_t* decoded_bits)
return false;
}
mylog(boost::format("encoding: %1% - length: %2% - symbols: %3%") % d_frame_encoding %
d_frame_bytes % d_frame_symbols);
mylog("encoding: {} - length: {} - symbols: {}",
d_frame_encoding,
d_frame_bytes,
d_frame_symbols);
return true;
}
+1 -2
View File
@@ -21,7 +21,6 @@
#include <gnuradio/io_signature.h>
#include <string>
#include <iomanip>
#include <boost/format.hpp>
using namespace gr::ieee802_11;
@@ -64,7 +63,7 @@ public:
int frame_len = pmt::blob_length(d_msg);
mac_header* h = (mac_header*)pmt::blob_data(d_msg);
mylog(boost::format("length: %1%") % frame_len);
mylog("length: {}",frame_len);
dout << std::endl << "new mac frame (length " << frame_len << ")" << std::endl;
dout << "=========================================" << std::endl;
+1 -2
View File
@@ -23,7 +23,6 @@
#include <list>
#include <tuple>
#include <boost/format.hpp>
using namespace gr::ieee802_11;
using namespace std;
@@ -113,7 +112,7 @@ public:
if (d_offset == SYNC_LENGTH) {
search_frame_start();
mylog(boost::format("LONG: frame start at %1%") % d_frame_start);
mylog("LONG: frame start at {}",d_frame_start);
d_offset = 0;
d_count = 0;
d_state = COPY;
+1 -2
View File
@@ -19,7 +19,6 @@
#include <ieee802_11/sync_short.h>
#include <iostream>
#include <boost/format.hpp>
using namespace gr::ieee802_11;
@@ -139,7 +138,7 @@ public:
void insert_tag(uint64_t item, double freq_offset, uint64_t input_item)
{
mylog(boost::format("frame start at in: %2% out: %1%") % item % input_item);
mylog("frame start at in: {} out: {}", item, input_item);
const pmt::pmt_t key = pmt::string_to_symbol("wifi_start");
const pmt::pmt_t value = pmt::from_double(freq_offset);
+2 -2
View File
@@ -32,10 +32,10 @@ using gr::ieee802_11::Encoding;
#define MAX_ENCODED_BITS ((16 + 8 * MAX_PSDU_SIZE + 6) * 2 + MAX_BITS_PER_SYM)
#define dout d_debug&& std::cout
#define mylog(msg) \
#define mylog(...) \
do { \
if (d_log) { \
GR_LOG_INFO(d_logger, msg); \
d_logger->info(__VA_ARGS__); \
} \
} while (0);