AdminUtils.cpp 733 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <jsonrpccpp/common/exception.h>
  2. #include <libdevcore/Log.h>
  3. #include <libethereum/Client.h>
  4. #include "SessionManager.h"
  5. #include "AdminUtils.h"
  6. using namespace std;
  7. using namespace dev;
  8. using namespace dev::eth;
  9. using namespace dev::rpc;
  10. AdminUtils::AdminUtils(SessionManager& _sm, SystemManager* _systemManager):
  11. m_sm(_sm),
  12. m_systemManager(_systemManager)
  13. {}
  14. bool AdminUtils::admin_setVerbosity(int _v, std::string const& _session)
  15. {
  16. RPC_ADMIN;
  17. return admin_verbosity(_v);
  18. }
  19. bool AdminUtils::admin_verbosity(int _v)
  20. {
  21. g_logVerbosity = _v;
  22. return true;
  23. }
  24. bool AdminUtils::admin_exit(std::string const& _session)
  25. {
  26. RPC_ADMIN;
  27. if (m_systemManager)
  28. {
  29. m_systemManager->exit();
  30. return true;
  31. }
  32. return false;
  33. }