Merge branch 'master' of github.com:cryptonomex/graphene
This commit is contained in:
commit
984cf47841
1 changed files with 80 additions and 68 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include <graphene/account_history/account_history_plugin.hpp>
|
||||
#include <graphene/market_history/market_history_plugin.hpp>
|
||||
|
||||
#include <fc/exception/exception.hpp>
|
||||
#include <fc/thread/thread.hpp>
|
||||
#include <fc/interprocess/signals.hpp>
|
||||
#include <fc/log/console_appender.hpp>
|
||||
|
|
@ -100,10 +101,17 @@ int main(int argc, char** argv) {
|
|||
bpo::store(bpo::parse_config_file<char>(config_ini_path.preferred_string().c_str(), cfg_options, true), options);
|
||||
|
||||
// try to get logging options from the config file.
|
||||
try
|
||||
{
|
||||
fc::optional<fc::logging_config> logging_config = load_logging_config_from_ini_file(config_ini_path);
|
||||
if (logging_config)
|
||||
fc::configure_logging(*logging_config);
|
||||
}
|
||||
catch (const fc::exception&)
|
||||
{
|
||||
wlog("Error parsing logging config from config file ${config}, using default config", ("config", config_ini_path.preferred_string()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ilog("Writing new config file at ${path}", ("path", config_ini_path));
|
||||
|
|
@ -195,6 +203,8 @@ void write_default_logging_config_to_stream(std::ostream& out)
|
|||
|
||||
fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::path& config_ini_filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
fc::logging_config logging_config;
|
||||
bool found_logging_config = false;
|
||||
|
||||
|
|
@ -267,4 +277,6 @@ fc::optional<fc::logging_config> load_logging_config_from_ini_file(const fc::pat
|
|||
return logging_config;
|
||||
else
|
||||
return fc::optional<fc::logging_config>();
|
||||
}
|
||||
FC_RETHROW_EXCEPTIONS(warn, "")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue