mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Rename reported log_msg struct to log_msg_t
MySQL defines a macro log_msg in one of its headers, which causes log_msg to be replaced with different symbol in some compilation units. Fix by renaming the struct to log_msg_t to avoid the conflict.
This commit is contained in:
@ -105,21 +105,21 @@ namespace wsrep
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
double tstamp;
|
double tstamp;
|
||||||
std::string msg;
|
std::string msg;
|
||||||
} log_msg;
|
} log_msg_t ;
|
||||||
|
|
||||||
std::deque<log_msg> err_msg_;
|
std::deque<log_msg_t> err_msg_;
|
||||||
std::deque<log_msg> warn_msg_;
|
std::deque<log_msg_t> warn_msg_;
|
||||||
std::deque<log_msg> events_;
|
std::deque<log_msg_t> events_;
|
||||||
size_t const max_msg_;
|
size_t const max_msg_;
|
||||||
|
|
||||||
static void write_log_msg(std::ostream& os,
|
static void write_log_msg(std::ostream& os,
|
||||||
const log_msg& msg);
|
const log_msg_t& msg);
|
||||||
static void write_event(std::ostream& os,
|
static void write_event(std::ostream& os,
|
||||||
const log_msg& msg);
|
const log_msg_t& msg);
|
||||||
static void write_array(std::ostream& os, const std::string& label,
|
static void write_array(std::ostream& os, const std::string& label,
|
||||||
const std::deque<log_msg>& events,
|
const std::deque<log_msg_t>& events,
|
||||||
void (*element_writer)(std::ostream& os,
|
void (*element_writer)(std::ostream& os,
|
||||||
const log_msg& msg));
|
const log_msg_t& msg));
|
||||||
substates substate_map(enum server_state::state state);
|
substates substate_map(enum server_state::state state);
|
||||||
float progress_map(float progress) const;
|
float progress_map(float progress) const;
|
||||||
void write_file(double timestamp);
|
void write_file(double timestamp);
|
||||||
|
@ -176,7 +176,7 @@ static std::string escape_json(const std::string& str)
|
|||||||
|
|
||||||
void
|
void
|
||||||
wsrep::reporter::write_log_msg(std::ostream& os,
|
wsrep::reporter::write_log_msg(std::ostream& os,
|
||||||
const log_msg& msg)
|
const log_msg_t& msg)
|
||||||
{
|
{
|
||||||
os << "\t\t{\n";
|
os << "\t\t{\n";
|
||||||
os << "\t\t\t\"timestamp\": " << std::showpoint << std::setprecision(18)
|
os << "\t\t\t\"timestamp\": " << std::showpoint << std::setprecision(18)
|
||||||
@ -187,7 +187,7 @@ wsrep::reporter::write_log_msg(std::ostream& os,
|
|||||||
|
|
||||||
void
|
void
|
||||||
wsrep::reporter::write_event(std::ostream& os,
|
wsrep::reporter::write_event(std::ostream& os,
|
||||||
const log_msg& msg)
|
const log_msg_t& msg)
|
||||||
{
|
{
|
||||||
os << "\t\t{\n";
|
os << "\t\t{\n";
|
||||||
os << "\t\t\t\"timestamp\": " << std::showpoint << std::setprecision(18)
|
os << "\t\t\t\"timestamp\": " << std::showpoint << std::setprecision(18)
|
||||||
@ -199,9 +199,9 @@ wsrep::reporter::write_event(std::ostream& os,
|
|||||||
void
|
void
|
||||||
wsrep::reporter::write_array(std::ostream& os,
|
wsrep::reporter::write_array(std::ostream& os,
|
||||||
const std::string& label,
|
const std::string& label,
|
||||||
const std::deque<log_msg>& msgs,
|
const std::deque<log_msg_t>& msgs,
|
||||||
void (*element_writer)(std::ostream& os,
|
void (*element_writer)(std::ostream& os,
|
||||||
const log_msg& msg))
|
const log_msg_t& msg))
|
||||||
{
|
{
|
||||||
os << "\t\"" << label << "\": [\n";
|
os << "\t\"" << label << "\": [\n";
|
||||||
for (size_t i(0); i < msgs.size(); ++i)
|
for (size_t i(0); i < msgs.size(); ++i)
|
||||||
@ -351,7 +351,7 @@ wsrep::reporter::report_log_msg(log_level const lvl,
|
|||||||
const std::string& msg,
|
const std::string& msg,
|
||||||
double tstamp)
|
double tstamp)
|
||||||
{
|
{
|
||||||
std::deque<log_msg>& deque(lvl == error ? err_msg_ : warn_msg_);
|
std::deque<log_msg_t>& deque(lvl == error ? err_msg_ : warn_msg_);
|
||||||
|
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ wsrep::reporter::report_log_msg(log_level const lvl,
|
|||||||
|
|
||||||
/* Log messages are not expected to be json formatted, so we escape
|
/* Log messages are not expected to be json formatted, so we escape
|
||||||
the message strings here to keep the report file well formatted. */
|
the message strings here to keep the report file well formatted. */
|
||||||
log_msg entry({tstamp, escape_json(msg)});
|
log_msg_t entry({tstamp, escape_json(msg)});
|
||||||
deque.push_back(entry);
|
deque.push_back(entry);
|
||||||
write_file(tstamp);
|
write_file(tstamp);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user