feat(logger): Enhance logging functionality with variadic templates for formatted messages
- Added variadic template methods to the Logger class for formatted logging at different log levels (debug, info, warn, error). - Updated existing logging calls in CustomRobot to utilize the new formatted logging methods for improved readability and consistency. - Removed the old log method implementation from logger.cpp to streamline the codebase.
This commit is contained in:
@@ -321,13 +321,13 @@ bool CustomRobot::processLowCmd(const std::string& cmd, const nlohmann::json& me
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("Unknown Low command: " + cmd);
|
||||
LOG_ERROR("Unknown Low command: %s", cmd.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG_ERROR("Error executing Low command " + cmd + ": " + std::string(e.what()));
|
||||
LOG_ERROR("Error executing Low command %s: %s", cmd.c_str(), e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user