Skip to content

Commit fd36876

Browse files
author
Antoine Bussy
committed
Prevent duplication of log columns.
Duplication becomes problematic with multiple runs, e.g. in MPC.
1 parent 3a23ac0 commit fd36876

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)