Skip to content

Commit

Permalink
fix console printer to also print unknown levels
Browse files Browse the repository at this point in the history
this can happen if people added their own log4cxx levels
In this case, still print the message on the console in red with "UNKNO" level instead of just printing a newline.
  • Loading branch information
flixr committed Jan 12, 2020
1 parent af78c22 commit 58c1e10
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/rosconsole/rosconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ void Formatter::init(const char* fmt)

void Formatter::print(void* logger_handle, ::ros::console::Level level, const char* str, const char* file, const char* function, int line)
{
const char* color = NULL;
const char* color = COLOR_RED;
FILE* f = stdout;

if (level == levels::Fatal)
Expand All @@ -362,8 +362,6 @@ void Formatter::print(void* logger_handle, ::ros::console::Level level, const ch
color = COLOR_GREEN;
}

ROS_ASSERT(color != NULL);

std::stringstream ss;
ss << color;
V_Token::iterator it = tokens_.begin();
Expand Down

0 comments on commit 58c1e10

Please sign in to comment.