mirror of
https://github.com/monero-project/monero.git
synced 2025-08-03 23:34:17 -04:00
Properly format multiline logs
As a side effect, colouring on Windows should now work regardless of version
This commit is contained in:
parent
2c171a9b02
commit
32f725d32f
8 changed files with 217 additions and 66 deletions
|
@ -34,7 +34,7 @@
|
|||
#define MONERO_DEFAULT_LOG_CATEGORY "perf"
|
||||
|
||||
#define PERF_LOG_ALWAYS(level, cat, x) \
|
||||
el::base::Writer(level, __FILE__, __LINE__, ELPP_FUNC, el::base::DispatchAction::FileOnlyLog).construct(cat) << x
|
||||
el::base::Writer(level, el::Color::Default, __FILE__, __LINE__, ELPP_FUNC, el::base::DispatchAction::FileOnlyLog).construct(cat) << x
|
||||
#define PERF_LOG(level, cat, x) \
|
||||
do { \
|
||||
if (ELPP->vRegistry()->allowed(level, cat)) PERF_LOG_ALWAYS(level, cat, x); \
|
||||
|
|
|
@ -1641,7 +1641,7 @@ namespace cryptonote
|
|||
break;
|
||||
case HardFork::UpdateNeeded:
|
||||
level = el::Level::Info;
|
||||
MCLOG(level, "global", "Last scheduled hard fork time suggests a daemon update will be released within the next couple months.");
|
||||
MCLOG(level, "global", el::Color::Default, "Last scheduled hard fork time suggests a daemon update will be released within the next couple months.");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
if (ELPP->vRegistry()->allowed(level, cat)) { \
|
||||
init; \
|
||||
if (test) \
|
||||
el::base::Writer(level, __FILE__, __LINE__, ELPP_FUNC, el::base::DispatchAction::NormalLog).construct(cat) << x; \
|
||||
el::base::Writer(level, el::Color::Default, __FILE__, __LINE__, ELPP_FUNC, el::base::DispatchAction::NormalLog).construct(cat) << x; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
@ -370,7 +370,7 @@ namespace cryptonote
|
|||
uint64_t max_block_height = std::max(hshd.current_height,m_core.get_current_blockchain_height());
|
||||
uint64_t last_block_v1 = m_core.get_nettype() == TESTNET ? 624633 : m_core.get_nettype() == MAINNET ? 1009826 : (uint64_t)-1;
|
||||
uint64_t diff_v2 = max_block_height > last_block_v1 ? std::min(abs_diff, max_block_height - last_block_v1) : 0;
|
||||
MCLOG(is_inital ? el::Level::Info : el::Level::Debug, "global", context << "Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
|
||||
MCLOG(is_inital ? el::Level::Info : el::Level::Debug, "global", el::Color::Yellow, context << "Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
|
||||
<< " [Your node is " << abs_diff << " blocks (" << ((abs_diff - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) "
|
||||
<< (0 <= diff ? std::string("behind") : std::string("ahead"))
|
||||
<< "] " << ENDL << "SYNCHRONIZATION started");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue