Skip to content

Commit

Permalink
Merge pull request #9 from Doy-lee/master
Browse files Browse the repository at this point in the history
Merge monero to loki string changes
Haafingar authored Apr 10, 2018
2 parents aa9e975 + 0a87d93 commit 0d1c4a6
Showing 105 changed files with 465 additions and 1,120 deletions.
30 changes: 15 additions & 15 deletions contrib/epee/include/misc_log_ex.h
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@

#include "easylogging++.h"

#define MONERO_DEFAULT_LOG_CATEGORY "default"
#define LOKI_DEFAULT_LOG_CATEGORY "default"
#define MAX_LOG_FILE_SIZE 104850000 // 100 MB - 7600 bytes

#define MCFATAL(cat,x) CLOG(FATAL,cat) << x
@@ -52,20 +52,20 @@
#define MCLOG_MAGENTA(level,cat,x) MCLOG_COLOR(level,cat,"35",x)
#define MCLOG_CYAN(level,cat,x) MCLOG_COLOR(level,cat,"36",x)

#define MLOG_RED(level,x) MCLOG_RED(level,MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG_GREEN(level,x) MCLOG_GREEN(level,MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG_YELLOW(level,x) MCLOG_YELLOW(level,MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG_BLUE(level,x) MCLOG_BLUE(level,MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG_MAGENTA(level,x) MCLOG_MAGENTA(level,MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG_CYAN(level,x) MCLOG_CYAN(level,MONERO_DEFAULT_LOG_CATEGORY,x)

#define MFATAL(x) MCFATAL(MONERO_DEFAULT_LOG_CATEGORY,x)
#define MERROR(x) MCERROR(MONERO_DEFAULT_LOG_CATEGORY,x)
#define MWARNING(x) MCWARNING(MONERO_DEFAULT_LOG_CATEGORY,x)
#define MINFO(x) MCINFO(MONERO_DEFAULT_LOG_CATEGORY,x)
#define MDEBUG(x) MCDEBUG(MONERO_DEFAULT_LOG_CATEGORY,x)
#define MTRACE(x) MCTRACE(MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG(level,x) MCLOG(level,MONERO_DEFAULT_LOG_CATEGORY,x)
#define MLOG_RED(level,x) MCLOG_RED(level,LOKI_DEFAULT_LOG_CATEGORY,x)
#define MLOG_GREEN(level,x) MCLOG_GREEN(level,LOKI_DEFAULT_LOG_CATEGORY,x)
#define MLOG_YELLOW(level,x) MCLOG_YELLOW(level,LOKI_DEFAULT_LOG_CATEGORY,x)
#define MLOG_BLUE(level,x) MCLOG_BLUE(level,LOKI_DEFAULT_LOG_CATEGORY,x)
#define MLOG_MAGENTA(level,x) MCLOG_MAGENTA(level,LOKI_DEFAULT_LOG_CATEGORY,x)
#define MLOG_CYAN(level,x) MCLOG_CYAN(level,LOKI_DEFAULT_LOG_CATEGORY,x)

#define MFATAL(x) MCFATAL(LOKI_DEFAULT_LOG_CATEGORY,x)
#define MERROR(x) MCERROR(LOKI_DEFAULT_LOG_CATEGORY,x)
#define MWARNING(x) MCWARNING(LOKI_DEFAULT_LOG_CATEGORY,x)
#define MINFO(x) MCINFO(LOKI_DEFAULT_LOG_CATEGORY,x)
#define MDEBUG(x) MCDEBUG(LOKI_DEFAULT_LOG_CATEGORY,x)
#define MTRACE(x) MCTRACE(LOKI_DEFAULT_LOG_CATEGORY,x)
#define MLOG(level,x) MCLOG(level,LOKI_DEFAULT_LOG_CATEGORY,x)

#define MGINFO(x) MCINFO("global",x)
#define MGINFO_RED(x) MCLOG_RED(el::Level::Info, "global",x)
4 changes: 2 additions & 2 deletions contrib/epee/include/net/abstract_tcp_server.h
Original file line number Diff line number Diff line change
@@ -38,8 +38,8 @@

#pragma comment(lib, "Ws2_32.lib")

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/abstract_tcp_server2.h
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@
#include "connection_basic.hpp"
#include "network_throttle-detail.hpp"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

#define ABSTRACT_SERVER_SEND_QUE_MAX_COUNT 1000

4 changes: 2 additions & 2 deletions contrib/epee/include/net/abstract_tcp_server2.inl
Original file line number Diff line number Diff line change
@@ -51,8 +51,8 @@

#include "../../../../src/cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal()

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

PRAGMA_WARNING_PUSH
namespace epee
4 changes: 2 additions & 2 deletions contrib/epee/include/net/abstract_tcp_server_cp.h
Original file line number Diff line number Diff line change
@@ -42,8 +42,8 @@
#include "net_utils_base.h"
#include "pragma_comp_defs.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

#define LEVIN_DEFAULT_DATA_BUFF_SIZE 2000

4 changes: 2 additions & 2 deletions contrib/epee/include/net/abstract_tcp_server_cp.inl
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@

#pragma comment(lib, "Ws2_32.lib")

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_auth.h
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@
#include "wipeable_string.h"
#include "http_base.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_base.h
Original file line number Diff line number Diff line change
@@ -35,8 +35,8 @@

#include "string_tools.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_client.h
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@

//#pragma comment(lib, "shlwapi.lib")

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

extern epee::critical_section gregexp_lock;

4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_client_base.h
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@

#pragma once

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_client_via_api_helper.h
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@
#include <atlutil.h>
#pragma comment(lib, "Wininet.lib")

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_protocol_handler.h
Original file line number Diff line number Diff line change
@@ -37,8 +37,8 @@
#include "http_auth.h"
#include "http_base.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_protocol_handler.inl
Original file line number Diff line number Diff line change
@@ -33,8 +33,8 @@
#include "file_io_utils.h"
#include "net_parse_helpers.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

#define HTTP_MAX_URI_LEN 9000
#define HTTP_MAX_HEADER_LEN 100000
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_server_cp.h
Original file line number Diff line number Diff line change
@@ -33,8 +33,8 @@
#include "abstract_tcp_server_cp.h"
#include "http_server.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_server_cp2.h
Original file line number Diff line number Diff line change
@@ -33,8 +33,8 @@
#include "abstract_tcp_server2.h"
#include "http_protocol_handler.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_server_handlers_map2.h
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@
#include "storages/portable_storage.h"
#include "storages/portable_storage_template_helper.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"


#define CHAIN_HTTP_TO_MAP2(context_type) bool handle_http_request(const epee::net_utils::http::http_request_info& query_info, \
4 changes: 2 additions & 2 deletions contrib/epee/include/net/http_server_impl_base.h
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@
#include "net/http_server_cp2.h"
#include "net/http_server_handlers_map2.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.http"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/levin_client.inl
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@
//------------------------------------------------------------------------------
#include "string_tools.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/levin_client_async.h
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@
#include "net_helper.h"
#include "levin_base.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"


namespace epee
4 changes: 2 additions & 2 deletions contrib/epee/include/net/levin_helper.h
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@
#include "levin_base.h"
#include "serializeble_struct_helper.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/levin_protocol_handler.h
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@
#include <boost/uuid/uuid_generators.hpp>
#include "levin_base.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/levin_protocol_handler_async.h
Original file line number Diff line number Diff line change
@@ -41,8 +41,8 @@
#include <random>
#include <chrono>

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

#ifndef MIN_BYTES_WANTED
#define MIN_BYTES_WANTED 512
4 changes: 2 additions & 2 deletions contrib/epee/include/net/net_helper.h
Original file line number Diff line number Diff line change
@@ -42,8 +42,8 @@
#include "net/net_utils_base.h"
#include "misc_language.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

#ifndef MAKE_IP
#define MAKE_IP( a1, a2, a3, a4 ) (a1|(a2<<8)|(a3<<16)|(a4<<24))
4 changes: 2 additions & 2 deletions contrib/epee/include/net/net_parse_helpers.h
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@
#include "http_base.h"
#include "reg_exp_definer.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/include/net/net_utils_base.h
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@
#include "serialization/keyvalue_serialization.h"
#include "misc_log_ex.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

#ifndef MAKE_IP
#define MAKE_IP( a1, a2, a3, a4 ) (a1|(a2<<8)|(a3<<16)|(a4<<24))
4 changes: 2 additions & 2 deletions contrib/epee/include/storages/levin_abstract_invoke2.h
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@
#include <boost/utility/value_init.hpp>
#include "net/levin_base.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net"

namespace epee
{
4 changes: 2 additions & 2 deletions contrib/epee/src/connection_basic.cpp
Original file line number Diff line number Diff line change
@@ -79,8 +79,8 @@
// TODO:
#include "net/network_throttle-detail.hpp"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.p2p"

// ################################################################################################
// local (TU local) headers
6 changes: 3 additions & 3 deletions contrib/epee/src/mlog.cpp
Original file line number Diff line number Diff line change
@@ -35,12 +35,12 @@
#include "string_tools.h"
#include "misc_log_ex.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "logging"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "logging"

#define MLOG_BASE_FORMAT "%datetime{%Y-%M-%d %H:%m:%s.%g}\t%thread\t%level\t%logger\t%loc\t%msg"

#define MLOG_LOG(x) CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,MONERO_DEFAULT_LOG_CATEGORY) << x
#define MLOG_LOG(x) CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,LOKI_DEFAULT_LOG_CATEGORY) << x

using namespace epee;

4 changes: 2 additions & 2 deletions contrib/epee/src/network_throttle-detail.cpp
Original file line number Diff line number Diff line change
@@ -76,8 +76,8 @@
// TODO:
#include "net/network_throttle-detail.hpp"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.throttle"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.throttle"

// ################################################################################################
// ################################################################################################
5 changes: 3 additions & 2 deletions src/blockchain_db/blockchain_db.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2014-2018, The Monero Project
// Copyright (c) 2018, The Loki Project
//
// All rights reserved.
//
@@ -47,8 +48,8 @@ static const char *db_types[] = {
NULL
};

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "blockchain.db"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "blockchain.db"

using epee::string_tools::pod_to_hex;

7 changes: 4 additions & 3 deletions src/blockchain_db/lmdb/db_lmdb.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2014-2018, The Monero Project
// Copyright (c) 2018, The Loki Project
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
@@ -41,8 +42,8 @@
#include "profile_tools.h"
#include "ringct/rctOps.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "blockchain.db.lmdb"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "blockchain.db.lmdb"


#if defined(__i386) || defined(__x86_64)
@@ -3267,7 +3268,7 @@ void BlockchainLMDB::fixup()
ptr = (char *)k.mv_data; \
ptr[sizeof(name)-2] = 's'

#define LOGIF(y) if (ELPP->vRegistry()->allowed(y, MONERO_DEFAULT_LOG_CATEGORY))
#define LOGIF(y) if (ELPP->vRegistry()->allowed(y, LOKI_DEFAULT_LOG_CATEGORY))

void BlockchainLMDB::migrate_0_1()
{
Loading

0 comments on commit 0d1c4a6

Please sign in to comment.