Skip to content

Commit

Permalink
Tweak example
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
  • Loading branch information
caguero committed Aug 16, 2024
1 parent 215e1d2 commit 28f70ad
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions examples/console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@

int main(int argc, char **argv)
{
// Default verbosity is 1, only error messages show
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 1, only critical and error 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";

// Change verbosity to level 4, all messages show
// gz::common::ConsoleGlobal::SetVerbosity(4);
// gz::common::ConsoleGlobal::SetPrefix("My prefix. ");
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";
// Change verbosity to level 5, 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";

std::filesystem::path logDir = std::filesystem::temp_directory_path();
std::filesystem::path logFile = "my_log.txt";
Expand Down

0 comments on commit 28f70ad

Please sign in to comment.