mirror of
https://github.com/monero-project/monero.git
synced 2025-06-21 06:14:11 -04:00
Merge pull request #2281
e499ff33
simplewallet: factor out message_writer (moneromooo-monero)7ed5ab47
scoped_message_writer: pause readline to match simplewallet (moneromooo-monero)
This commit is contained in:
commit
e457cc7891
2 changed files with 21 additions and 84 deletions
|
@ -31,6 +31,14 @@
|
|||
#include "misc_log_ex.h"
|
||||
#include <iostream>
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
#include "readline_buffer.h"
|
||||
#define PAUSE_READLINE() \
|
||||
rdln::suspend_readline pause_readline;
|
||||
#else
|
||||
#define PAUSE_READLINE()
|
||||
#endif
|
||||
|
||||
namespace tools
|
||||
{
|
||||
|
||||
|
@ -99,6 +107,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
PAUSE_READLINE();
|
||||
set_console_color(m_color, m_bright);
|
||||
std::cout << m_oss.str();
|
||||
epee::reset_console_color();
|
||||
|
@ -108,9 +117,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
inline scoped_message_writer success_msg_writer()
|
||||
inline scoped_message_writer success_msg_writer(bool color = true)
|
||||
{
|
||||
return scoped_message_writer(epee::console_color_green, false, std::string(), el::Level::Info);
|
||||
return scoped_message_writer(color ? epee::console_color_green : epee::console_color_default, false, std::string(), el::Level::Info);
|
||||
}
|
||||
|
||||
inline scoped_message_writer msg_writer(epee::console_colors color = epee::console_color_default)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue