Skip to content

Commit ec14031

Browse files
authored
Remove color code in logger (#6)
1 parent 0d0d73e commit ec14031

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

src/RadioManagementModule.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,12 @@ void RadioManagementModule::PHY_HandleSwChnlAndSetBW8812(
145145
ChannelWidth_t ChnlWidth, uint8_t ChnlOffsetOf40MHz,
146146
uint8_t ChnlOffsetOf80MHz, uint8_t CenterFrequencyIndex1) {
147147
_logger->info(
148-
"=> PHY_HandleSwChnlAndSetBW8812: bSwitchChannel {}, bSetBandWidth * {}",
148+
"[{}] bSwitchChannel {}, bSetBandWidth {}", __func__,
149149
bSwitchChannel, bSetBandWidth);
150150

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

@@ -175,8 +174,7 @@ void RadioManagementModule::PHY_HandleSwChnlAndSetBW8812(
175174
}
176175

177176
if (!_setChannelBw && !_swChannel && _needIQK != true) {
178-
_logger->error("<= PHY_HandleSwChnlAndSetBW8812: SwChnl {}, "
179-
"_setChannelBw {}",
177+
_logger->error("[{}]: _swChannel {}, _setChannelBw {}", __func__,
180178
_swChannel, _setChannelBw);
181179
return;
182180
}
@@ -357,8 +355,7 @@ void RadioManagementModule::PHY_SwitchWirelessBand8812(BandType Band) {
357355
ChannelWidth_t current_bw = _currentChannelBw;
358356
bool eLNA_2g = _eepromManager->ExternalLNA_2G;
359357

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

363360
current_band_type = Band;
364361

@@ -1173,7 +1170,7 @@ void RadioManagementModule::PHY_SetTxPowerIndex_8812A(uint32_t powerIndex,
11731170

11741171
void RadioManagementModule::phy_set_tx_power_index_by_rate_section(
11751172
RfPath rfPath, uint8_t channel, RATE_SECTION rateSection) {
1176-
_logger->debug("SET_TX_POWER {}; {}; {}", (int)rfPath, (int)channel,
1173+
_logger->debug("SET_TX_POWER {} - {} - {}", (int)rfPath, (int)channel,
11771174
(int)rateSection);
11781175

11791176
if (rateSection >= RATE_SECTION::RATE_SECTION_NUM) {

src/logger.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
#else
2525
#include <cstdio>
2626

27-
#define RESET "\033[0m"
28-
#define RED "\033[31m"
29-
#define GREEN "\033[32m"
30-
#define YELLOW "\033[33m"
31-
3227
#define DEVOURER_LOGV(...) \
3328
printf("<%s>", DEVOURER_LOG_TAG); \
3429
printf(__VA_ARGS__); \
@@ -42,13 +37,13 @@
4237
printf(__VA_ARGS__); \
4338
printf("\n")
4439
#define DEVOURER_LOGW(...) \
45-
printf(YELLOW "<%s>", DEVOURER_LOG_TAG); \
40+
printf("<%s>", DEVOURER_LOG_TAG); \
4641
printf(__VA_ARGS__); \
47-
printf("\n" RESET)
42+
printf("\n")
4843
#define DEVOURER_LOGE(...) \
49-
printf(RED "<%s>", DEVOURER_LOG_TAG); \
44+
printf("<%s>", DEVOURER_LOG_TAG); \
5045
printf(__VA_ARGS__); \
51-
printf("\n" RESET)
46+
printf("\n")
5247
#endif
5348

5449
template<typename T>

0 commit comments

Comments
 (0)