New log support.

This commit is contained in:
XMRig 2019-03-27 01:29:37 +07:00
parent 17e9e036f1
commit f43929db98
26 changed files with 96 additions and 198 deletions

View file

@ -29,7 +29,7 @@
#include <uv.h>
#include "log/Log.h"
#include "base/io/log/Log.h"
#include "Platform.h"
#include "version.h"

View file

@ -28,12 +28,12 @@
#include "api/Api.h"
#include "base/io/log/Log.h"
#include "base/tools/Handle.h"
#include "base/tools/Timer.h"
#include "common/api/Httpd.h"
#include "common/api/HttpReply.h"
#include "common/api/HttpRequest.h"
#include "common/log/Log.h"
xmrig::Httpd::Httpd(int port, const char *accessToken, bool IPv6, bool restricted) :

View file

@ -55,8 +55,8 @@
#include "base/io/Json.h"
#include "base/io/log/Log.h"
#include "common/config/CommonConfig.h"
#include "common/log/Log.h"
#include "rapidjson/document.h"
#include "rapidjson/filewritestream.h"
#include "rapidjson/prettywriter.h"
@ -80,12 +80,6 @@ xmrig::CommonConfig::CommonConfig() :
}
bool xmrig::CommonConfig::isColors() const
{
return Log::colors;
}
void xmrig::CommonConfig::printAPI()
{
# ifndef XMRIG_NO_API
@ -93,9 +87,7 @@ void xmrig::CommonConfig::printAPI()
return;
}
Log::print(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN("%s:") CYAN_BOLD("%d")
: " * %-13s%s:%d",
"API BIND", isApiIPv6() ? "[::]" : "0.0.0.0", apiPort());
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN("%s:") CYAN_BOLD("%d"), "API BIND", isApiIPv6() ? "[::]" : "0.0.0.0", apiPort());
# endif
}
@ -118,9 +110,7 @@ void xmrig::CommonConfig::printVersions()
snprintf(buf, sizeof buf, "MSVC/%d", MSVC_VERSION);
# endif
Log::print(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%s/%s") WHITE_BOLD(" %s")
: " * %-13s%s/%s %s",
"ABOUT", APP_NAME, APP_VERSION, buf);
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%s/%s") WHITE_BOLD(" %s"), "ABOUT", APP_NAME, APP_VERSION, buf);
# if defined(XMRIG_AMD_PROJECT)
# if CL_VERSION_2_0
@ -157,9 +147,7 @@ void xmrig::CommonConfig::printVersions()
length += snprintf(buf + length, (sizeof buf) - length, "microhttpd/%s ", MHD_get_version());
# endif
Log::print(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13slibuv/%s %s")
: " * %-13slibuv/%s %s",
"LIBS", uv_version_string(), buf);
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13slibuv/%s %s"), "LIBS", uv_version_string(), buf);
}

View file

@ -61,7 +61,6 @@ public:
bool save() override;
bool isColors() const;
void printAPI();
void printPools();
void printVersions();

View file

@ -23,11 +23,11 @@
*/
#include "base/io/log/Log.h"
#include "base/io/Watcher.h"
#include "base/kernel/interfaces/IConfigListener.h"
#include "common/config/ConfigLoader.h"
#include "common/config/ConfigWatcher.h"
#include "common/log/Log.h"
#include "core/ConfigCreator.h"

View file

@ -1,32 +0,0 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_LOG_LEGACY_H
#define XMRIG_LOG_LEGACY_H
#include "base/io/log/Log.h"
#endif /* XMRIG_LOG_LEGACY_H */