mirror of
https://github.com/monero-project/monero.git
synced 2025-07-31 22:58:41 -04:00
commented util.h
This commit is contained in:
parent
bf972c40fc
commit
c085e9294f
5 changed files with 102 additions and 44 deletions
|
@ -29,7 +29,7 @@
|
|||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
// node.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
// Does this file exist?
|
||||
|
||||
|
||||
#include "include_base_utils.h"
|
||||
|
@ -64,11 +64,42 @@ namespace
|
|||
const command_line::arg_descriptor<bool> arg_console = {"no-console", "Disable daemon console commands"};
|
||||
}
|
||||
|
||||
bool command_line_preprocessor(const boost::program_options::variables_map& vm);
|
||||
bool command_line_preprocessor(const boost::program_options::variables_map& vm)
|
||||
{
|
||||
bool exit = false;
|
||||
if (command_line::get_arg(vm, command_line::arg_version))
|
||||
{
|
||||
std::cout << CRYPTONOTE_NAME << " v" << PROJECT_VERSION_LONG << ENDL;
|
||||
exit = true;
|
||||
}
|
||||
if (command_line::get_arg(vm, arg_os_version))
|
||||
{
|
||||
std::cout << "OS: " << tools::get_os_version_string() << ENDL;
|
||||
exit = true;
|
||||
}
|
||||
|
||||
if (exit)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int new_log_level = command_line::get_arg(vm, arg_log_level);
|
||||
if(new_log_level < LOG_LEVEL_MIN || new_log_level > LOG_LEVEL_MAX)
|
||||
{
|
||||
LOG_PRINT_L0("Wrong log level value: ");
|
||||
}
|
||||
else if (log_space::get_set_log_detalisation_level(false) != new_log_level)
|
||||
{
|
||||
log_space::get_set_log_detalisation_level(true, new_log_level);
|
||||
LOG_PRINT_L0("LOG_LEVEL set to " << new_log_level);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
|
||||
string_tools::set_module_name_and_folder(argv[0]);
|
||||
#ifdef WIN32
|
||||
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
||||
|
@ -235,35 +266,3 @@ int main(int argc, char* argv[])
|
|||
CATCH_ENTRY_L0("main", 1);
|
||||
}
|
||||
|
||||
bool command_line_preprocessor(const boost::program_options::variables_map& vm)
|
||||
{
|
||||
bool exit = false;
|
||||
if (command_line::get_arg(vm, command_line::arg_version))
|
||||
{
|
||||
std::cout << CRYPTONOTE_NAME << " v" << PROJECT_VERSION_LONG << ENDL;
|
||||
exit = true;
|
||||
}
|
||||
if (command_line::get_arg(vm, arg_os_version))
|
||||
{
|
||||
std::cout << "OS: " << tools::get_os_version_string() << ENDL;
|
||||
exit = true;
|
||||
}
|
||||
|
||||
if (exit)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int new_log_level = command_line::get_arg(vm, arg_log_level);
|
||||
if(new_log_level < LOG_LEVEL_MIN || new_log_level > LOG_LEVEL_MAX)
|
||||
{
|
||||
LOG_PRINT_L0("Wrong log level value: ");
|
||||
}
|
||||
else if (log_space::get_set_log_detalisation_level(false) != new_log_level)
|
||||
{
|
||||
log_space::get_set_log_detalisation_level(true, new_log_level);
|
||||
LOG_PRINT_L0("LOG_LEVEL set to " << new_log_level);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
|
||||
/* This isn't a header file, may want to refactor this... */
|
||||
#pragma once
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
@ -39,7 +41,11 @@
|
|||
#include "crypto/hash.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
/*!
|
||||
* \brief I don't really know right now
|
||||
*
|
||||
*
|
||||
*/
|
||||
class daemon_cmmands_handler
|
||||
{
|
||||
nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core> >& m_srv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue