Skip to content

Commit

Permalink
Add EoL and use SetConsoleSinkLevel
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero committed Sep 22, 2024
1 parent aae0d8c commit 5d4dd9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/log/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
int main(int argc, char** argv)
{
gz::utils::log::Logger logger("my_logger");
logger.RawLogger().set_level(spdlog::level::trace);
logger.SetConsoleSinkLevel(spdlog::level::trace);

std::filesystem::path logDir = std::filesystem::temp_directory_path();
std::filesystem::path logFile = "my_log.txt";
std::filesystem::path logPath = logDir / logFile;

logger.SetLogDestination(logPath);
logger.RawLogger().trace("trace");
logger.RawLogger().info("info");
logger.RawLogger().warn("warn");
logger.RawLogger().error("error");
logger.RawLogger().critical("critical");
logger.RawLogger().trace("trace\n");
logger.RawLogger().info("info\n");
logger.RawLogger().warn("warn\n");
logger.RawLogger().error("error\n");
logger.RawLogger().critical("critical\n");
}

0 comments on commit 5d4dd9c

Please sign in to comment.