mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Boost log integration. (#37)
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -14,6 +14,7 @@
|
||||
#include "crypto.hpp"
|
||||
#include "usr/usr.hpp"
|
||||
#include "proc.hpp"
|
||||
#include "hplog.hpp"
|
||||
|
||||
/**
|
||||
* Parses CLI args and extracts hot pocket command and parameters given.
|
||||
@@ -64,7 +65,7 @@ int parse_cmd(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// Extract the CLI args
|
||||
// After this call conf::ctx must be populated.
|
||||
// This call will populate conf::ctx
|
||||
if (parse_cmd(argc, argv) != 0)
|
||||
return -1;
|
||||
|
||||
@@ -100,7 +101,13 @@ int main(int argc, char **argv)
|
||||
else if (conf::ctx.command == "run")
|
||||
{
|
||||
// In order to host the contract we should init some required sub systems.
|
||||
if (conf::init() != 0 || usr::init() != 0)
|
||||
|
||||
if (conf::init() != 0)
|
||||
return -1;
|
||||
|
||||
hplog::init();
|
||||
|
||||
if (usr::init() != 0)
|
||||
return -1;
|
||||
|
||||
// This will start hosting the contract and start consensus rounds.
|
||||
@@ -143,7 +150,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (!hpscbufpair.second.empty())
|
||||
std::cout << "Message from SC: " << hpscbufpair.second << std::endl;
|
||||
LOG_DBG << "Message from SC: " << hpscbufpair.second;
|
||||
|
||||
userbufs.clear();
|
||||
}
|
||||
@@ -153,7 +160,8 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "exited normally\n";
|
||||
|
||||
LOG_INFO << "exited normally";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -162,6 +170,6 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
void boost::throw_exception(std::exception const &e)
|
||||
{
|
||||
std::cerr << "Boost error:" << e.what() << std::endl;
|
||||
LOG_ERR << "Boost error:" << e.what();
|
||||
exit(-1);
|
||||
}
|
||||
Reference in New Issue
Block a user