Skip to content

Commit

Permalink
Remove color code in logger (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
floppyhammer authored Jan 20, 2025
1 parent 0d0d73e commit ec14031
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
13 changes: 5 additions & 8 deletions src/RadioManagementModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ void RadioManagementModule::PHY_HandleSwChnlAndSetBW8812(
ChannelWidth_t ChnlWidth, uint8_t ChnlOffsetOf40MHz,
uint8_t ChnlOffsetOf80MHz, uint8_t CenterFrequencyIndex1) {
_logger->info(
"=> PHY_HandleSwChnlAndSetBW8812: bSwitchChannel {}, bSetBandWidth * {}",
"[{}] bSwitchChannel {}, bSetBandWidth {}", __func__,
bSwitchChannel, bSetBandWidth);

/* check is swchnl or setbw */
if (!bSwitchChannel && !bSetBandWidth) {
_logger->error("PHY_HandleSwChnlAndSetBW8812: not switch channel and "
"not set bandwidth");
_logger->error("[{}]: not switch channel and not set bandwidth", __func__);
return;
}

Expand All @@ -175,8 +174,7 @@ void RadioManagementModule::PHY_HandleSwChnlAndSetBW8812(
}

if (!_setChannelBw && !_swChannel && _needIQK != true) {
_logger->error("<= PHY_HandleSwChnlAndSetBW8812: SwChnl {}, "
"_setChannelBw {}",
_logger->error("[{}]: _swChannel {}, _setChannelBw {}", __func__,
_swChannel, _setChannelBw);
return;
}
Expand Down Expand Up @@ -357,8 +355,7 @@ void RadioManagementModule::PHY_SwitchWirelessBand8812(BandType Band) {
ChannelWidth_t current_bw = _currentChannelBw;
bool eLNA_2g = _eepromManager->ExternalLNA_2G;

_logger->info("==>PHY_SwitchWirelessBand8812() {}",
((Band == BandType::BAND_ON_2_4G) ? "2.4G" : "5G"));
_logger->info("[{}] {}", __func__, Band == BandType::BAND_ON_2_4G ? "2.4G" : "5G");

current_band_type = Band;

Expand Down Expand Up @@ -1173,7 +1170,7 @@ void RadioManagementModule::PHY_SetTxPowerIndex_8812A(uint32_t powerIndex,

void RadioManagementModule::phy_set_tx_power_index_by_rate_section(
RfPath rfPath, uint8_t channel, RATE_SECTION rateSection) {
_logger->debug("SET_TX_POWER {}; {}; {}", (int)rfPath, (int)channel,
_logger->debug("SET_TX_POWER {} - {} - {}", (int)rfPath, (int)channel,
(int)rateSection);

if (rateSection >= RATE_SECTION::RATE_SECTION_NUM) {
Expand Down
13 changes: 4 additions & 9 deletions src/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
#else
#include <cstdio>

#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define YELLOW "\033[33m"

#define DEVOURER_LOGV(...) \
printf("<%s>", DEVOURER_LOG_TAG); \
printf(__VA_ARGS__); \
Expand All @@ -42,13 +37,13 @@
printf(__VA_ARGS__); \
printf("\n")
#define DEVOURER_LOGW(...) \
printf(YELLOW "<%s>", DEVOURER_LOG_TAG); \
printf("<%s>", DEVOURER_LOG_TAG); \
printf(__VA_ARGS__); \
printf("\n" RESET)
printf("\n")
#define DEVOURER_LOGE(...) \
printf(RED "<%s>", DEVOURER_LOG_TAG); \
printf("<%s>", DEVOURER_LOG_TAG); \
printf(__VA_ARGS__); \
printf("\n" RESET)
printf("\n")
#endif

template<typename T>
Expand Down

0 comments on commit ec14031

Please sign in to comment.