Skip to content

Commit

Permalink
Display level is a way better name
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Sep 25, 2023
1 parent 22cf7cb commit 0cc19d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/message/LogMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ namespace message {
* @brief Construct a new Log Message object
*
* @param level the logging level of the log
* @param reactor_level the logging level of the reactor that made this log
* @param display_level the logging level of the reactor that made this log
* @param message the string contents of the message
* @param task the currently executing task that made this message or nullptr if not in a task
*/
LogMessage(const LogLevel& level,
const LogLevel& reactor_level,
const LogLevel& display_level,
const std::string& message,
const std::shared_ptr<ReactionStatistics>& task)
: level(level), reactor_level(reactor_level), message(message), task(task) {}
: level(level), display_level(display_level), message(message), task(task) {}

/// @brief The logging level of the log.
LogLevel level{};

/// @brief The logging level of the reactor that made this log.
LogLevel reactor_level{};
/// @brief The logging level of the reactor that made the log (the level to display at).
LogLevel display_level{};

/// @brief The string contents of the message.
std::string message{};
Expand Down
2 changes: 1 addition & 1 deletion tests/log/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TestReactor : public NUClear::Reactor {

// Capture the log messages
on<Trigger<NUClear::message::LogMessage>>().then([](const NUClear::message::LogMessage& log_message) {
if (log_message.level >= log_message.reactor_level) {
if (log_message.level >= log_message.display_level) {
messages.push_back(LogTestOutput{log_message.message, log_message.level, log_message.task != nullptr});
}
});
Expand Down

0 comments on commit 0cc19d9

Please sign in to comment.