19 LOGGER( applog,
"application" );
26 f_global_verbosity( 1 ),
27 f_nonoption_kw_args(),
28 f_nonoption_ord_args(),
33 add_option(
"-c,--config", f_config_filename,
"Config file filename" )->check(CLI::ExistingFile);
34 add_option(
"--verbosity", f_global_verbosity,
"Global logger verosity" );
36 auto t_version_callback = [](int)
41 add_flag_function(
"-V,--version", t_version_callback,
"Print the version message and exit" );
56 f_master_config.merge( f_default_config );
61 if( ! f_config_filename.empty() )
64 LDEBUG( applog,
"Loading config file <" << t_config_filepath <<
"> from filename <" << f_config_filename <<
">" );
66 std::unique_ptr< param > t_config_from_file( t_translator.
read_file( t_config_filepath.native() ));
67 if( t_config_from_file == NULL )
69 throw error() <<
"[application] error parsing config file";
71 if( ! t_config_from_file->is_node() )
73 throw error() <<
"[application] configuration file must consist of an object/node";
75 f_master_config.merge( t_config_from_file->as_node() );
81 f_nonoption_kw_args = t_no_parser.kw_args();
82 f_nonoption_ord_args = t_no_parser.ord_args();
86 LERROR( applog,
"Unable to parse remaining arguments: " << e.
what() );
92 f_master_config.merge( f_nonoption_kw_args );
95 f_master_config.merge( f_app_options );
97 LPROG( applog,
"Final configuration:\n" << f_master_config );
98 LPROG( applog,
"Ordered args:\n" << f_nonoption_ord_args );
path expand_path(const string &a_path)
static version_wrapper * get_instance()
virtual const char * what() const
Contains the logger class and macros, based on Kasper's KLogger class.
virtual void pre_callback()
void set_imp(scarab::version_semantic *a_imp)
param_ptr_t read_file(const std::string &a_filename, const param_node &a_options=param_node())
void set_version(version_semantic *a_ver)
This is a successful completion on parsing, supposed to exit.
Anything that can error in Parse.
LOGGER(mtlog,"authentication")