From db92b436462dbdd4af1c0eed5099388a3b0613ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ag=C3=BCero?= Date: Thu, 17 Oct 2024 17:17:00 +0200 Subject: [PATCH 1/2] Adds EoL to example (#642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Agüero --- examples/console.cc | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/examples/console.cc b/examples/console.cc index f86e2e0a..bc2a7143 100644 --- a/examples/console.cc +++ b/examples/console.cc @@ -19,23 +19,23 @@ int main(int argc, char **argv) { - // Default verbosity is 3 (critical, error, warn and info messages show). - gztrace << "This is a trace message"; - gzdbg << "This is a debug message"; - gzmsg << "This is an informational message"; - gzwarn << "This is a warning"; - gzerr << "This is an error"; - gzcrit << "This is a critical error"; + // Default verbosity is level 1 (err). + gztrace << "This is a trace message" << std::endl; + gzdbg << "This is a debug message" << std::endl; + gzmsg << "This is an informational message" << std::endl; + gzwarn << "This is a warning" << std::endl; + gzerr << "This is an error" << std::endl; + gzcrit << "This is a critical error" << std::endl; - // Change verbosity to level 5, all messages show. + // Change verbosity to level 5 (trace), all messages show. gz::common::Console::SetVerbosity(5); gz::common::Console::SetPrefix("My prefix. "); - gztrace << "This is a trace message"; - gzdbg << "This is a debug message"; - gzmsg << "This is an informational message"; - gzwarn << "This is a warning"; - gzerr << "This is an error"; - gzcrit << "This is a critical error"; + gztrace << "This is a trace message" << std::endl; + gzdbg << "This is a debug message" << std::endl; + gzmsg << "This is an informational message" << std::endl; + gzwarn << "This is a warning" << std::endl; + gzerr << "This is an error" << std::endl; + gzcrit << "This is a critical error" << std::endl; std::filesystem::path logDir = std::filesystem::temp_directory_path(); std::filesystem::path logFile = "my_log.txt"; @@ -43,14 +43,15 @@ int main(int argc, char **argv) gz::common::Console c("gz_tmp"); c.SetLogDestination(logDir / "tmp2" / logFile); auto logger = c.RawLogger(); - logger.log(spdlog::level::err, "Hello"); + logger.log(spdlog::level::err, "Hello\n"); gz::common::Console::Init(logDir / "tmp3", logFile); - gzerr << "Error 1"; - gzerr << "Error 2"; - gzerr << "Directory: " << gz::common::Console::Directory(); + gzerr << "Error 1" << std::endl; + gzerr << "Error 2" << std::endl; + gzerr << "Directory: " << gz::common::Console::Directory() << std::endl; gz::common::Console::Close(); - gzerr << "Error 3"; + // We shouldn't see this line in the log. + gzerr << "Error 3" << std::endl; return 0; } From 959f899ab239639fb5877f831c0059e16f5e6ef0 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 18 Oct 2024 16:43:25 -0500 Subject: [PATCH 2/2] Include math::Angle since it is used here (#649) Signed-off-by: Michael Carroll --- graphics/src/SVGLoader.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphics/src/SVGLoader.cc b/graphics/src/SVGLoader.cc index caa84674..1913af51 100644 --- a/graphics/src/SVGLoader.cc +++ b/graphics/src/SVGLoader.cc @@ -23,9 +23,10 @@ #include "tinyxml2.h" +#include "gz/math/Angle.hh" + #include "gz/common/Console.hh" #include "gz/common/Util.hh" - #include "gz/common/SVGLoader.hh" using namespace gz;