Skip to content

Commit a4a2f97

Browse files
REFACTOR: make logging more quiet (#422)
Co-authored-by: Павел Ральников <112890673+PaulRalnikov@users.noreply.github.com>
1 parent a0f66f7 commit a4a2f97

2 files changed

Lines changed: 12 additions & 17 deletions

File tree

source/device/switch.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ TimeNs Switch::process() {
2929
link->get_max_to_ingress_queue_size();
3030
std::optional<Packet> optional_packet = link->get_packet();
3131
if (!optional_packet.has_value()) {
32-
LOG_WARN("No packet in link");
3332
return total_processing_time;
3433
}
3534
Packet packet = optional_packet.value();

source/logger/logger.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,32 @@ static constexpr std::string_view file_name_from_path(std::string_view path) {
4949
return path.substr(pos + 1);
5050
}
5151

52-
void Logger::trace(std::string&& msg,
53-
const std::source_location& loc) {
52+
void Logger::trace(std::string&& msg, const std::source_location& loc) {
5453
SPDLOG_TRACE("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(),
5554
std::move(msg));
5655
}
5756

58-
void Logger::debug(std::string&& msg,
59-
const std::source_location& loc) {
57+
void Logger::debug(std::string&& msg, const std::source_location& loc) {
6058
SPDLOG_DEBUG("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(),
6159
std::move(msg));
6260
}
6361

64-
void Logger::info(std::string&& msg,
65-
const std::source_location& loc) {
66-
SPDLOG_INFO("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(), std::move(msg));
62+
void Logger::info(std::string&& msg, const std::source_location& loc) {
63+
SPDLOG_INFO("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(),
64+
std::move(msg));
6765
}
6866

69-
void Logger::warn(std::string&& msg,
70-
const std::source_location& loc) {
71-
SPDLOG_WARN("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(), std::move(msg));
67+
void Logger::warn(std::string&& msg, const std::source_location& loc) {
68+
SPDLOG_WARN("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(),
69+
std::move(msg));
7270
}
7371

74-
void Logger::error(std::string&& msg,
75-
const std::source_location& loc) {
72+
void Logger::error(std::string&& msg, const std::source_location& loc) {
7673
SPDLOG_ERROR("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(),
7774
std::move(msg));
7875
}
7976

80-
void Logger::critical(std::string&& msg,
81-
const std::source_location& loc) {
82-
SPDLOG_CRITICAL("[{}:{}] {}", file_name_from_path(loc.file_name()), loc.line(),
83-
std::move(msg));
77+
void Logger::critical(std::string&& msg, const std::source_location& loc) {
78+
SPDLOG_CRITICAL("[{}:{}] {}", file_name_from_path(loc.file_name()),
79+
loc.line(), std::move(msg));
8480
}

0 commit comments

Comments
 (0)