From 627f0242ad0d86bed0e5da7003cfe5693c85a5e7 Mon Sep 17 00:00:00 2001 From: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com> Date: Tue, 7 May 2019 08:39:52 +0200 Subject: [PATCH] [ROSAUTOTEST] Fix and improve some log handling (#1531) * wmain(): Use endl instead of '\n', for 'System uptime' * wmain(): Output "[ROSAUTOTEST] " in two cases: 'System uptime' and all CSimpleException. --- modules/rostests/rosautotest/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/rostests/rosautotest/main.cpp b/modules/rostests/rosautotest/main.cpp index 8d6d342da97..9c728d8d494 100644 --- a/modules/rostests/rosautotest/main.cpp +++ b/modules/rostests/rosautotest/main.cpp @@ -59,8 +59,10 @@ wmain(int argc, wchar_t* argv[]) Configuration.GetSystemInformation(); Configuration.GetConfigurationFromFile(); - ss << "\n\nSystem uptime " << setprecision(2) << fixed ; - ss << ((float)GetTickCount()/1000) << " seconds\n"; + ss << endl + << endl + << "[ROSAUTOTEST] System uptime " << setprecision(2) << fixed; + ss << ((float)GetTickCount()/1000) << " seconds" << endl; StringOut(ss.str()); /* Report tests startup */ @@ -89,8 +91,11 @@ wmain(int argc, wchar_t* argv[]) } catch(CSimpleException& e) { + stringstream ss; + // e.GetMessage() must include ending '\n'. - StringOut(e.GetMessage()); + ss << "[ROSAUTOTEST] " << e.GetMessage(); + StringOut(ss.str()); } catch(CFatalException& e) { -- 2.17.1