3#include <geogram/basic/logger.h>
4#include <geogram/basic/command_line.h>
5#include <geogram/basic/command_line_args.h>
11 class GeoLoggerForward :
public GEO::LoggerClient
20 std::string truncate(
const std::string &msg)
22 static size_t prefix_len = GEO::CmdLine::ui_feature(
" ",
false).size();
23 return msg.substr(prefix_len, msg.size() - 1 - prefix_len);
27 void div(
const std::string &title)
override
29 logger_->trace(title.substr(0, title.size() - 1));
32 void out(
const std::string &str)
override
37 void warn(
const std::string &str)
override
42 void err(
const std::string &str)
override
47 void status(
const std::string &str)
override
52 logger_->trace(str.substr(0, str.size() - 1));
65 setenv(
"GEO_NO_SIGNAL_HANDLER",
"1", 1);
71 GEO::CmdLine::import_arg_group(
"standard");
72 GEO::CmdLine::import_arg_group(
"pre");
73 GEO::CmdLine::import_arg_group(
"algo");
78 GEO::Logger *geo_logger = GEO::Logger::instance();
79 geo_logger->unregister_all_clients();
80 geo_logger->register_client(
new GeoLoggerForward(
logger.clone(
"geogram")));
81 geo_logger->set_pretty(
false);
std::shared_ptr< spdlog::logger > logger_
void set_logger(spdlog::logger &logger)
spdlog::logger & logger()
Retrieves the current logger.