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:
2025-09-22 19:35:03 +08:00
parent 5247295521
commit 20d75ca377
3 changed files with 64 additions and 62 deletions

View File

@@ -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;
}
}