Skip to content

Commit c51e68a

Browse files
authored
Merge pull request #271 from abussy-aldebaran/topic/fix-log
Prevent duplication of log columns.
2 parents 3a23ac0 + 159d785 commit c51e68a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Fixed copy of TrajOptProblem ([#265](https://github.com/Simple-Robotics/aligator/pull/265))
1919
- `LinesearchVariant::init()` should not be called unless the step accpetance strategy is a linesearch
2020
- Fixed compilation issues with C++20 (resolving [#246](https://github.com/Simple-Robotics/aligator/issues/246) and [#254](https://github.com/Simple-Robotics/aligator/discussions/254))
21+
- Prevent duplication of log columns ([#271](https://github.com/Simple-Robotics/aligator/pull/271))
2122

2223
### Added
2324

src/utils/logger.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ void Logger::finish(bool conv) {
4949

5050
void Logger::addColumn(std::string_view name, uint width,
5151
std::string_view format) {
52-
m_colNames.push_back(name);
52+
if (std::find(m_colNames.begin(), m_colNames.end(), name) == m_colNames.end())
53+
m_colNames.push_back(name);
5354
m_colSpecs[name] = {width, std::string(format)};
5455
}
5556

0 commit comments

Comments
 (0)