Switch to ilink3 logging group
This commit is contained in:
1 parent
c2abf90cc4
commit
31ccbfcd19
4 files changed
+22
-22
No files matched your search
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/build/ninja_debug/server/sparkd",
|
||||
"args": [
|
||||
"cmecert",
|
||||
"run",
|
||||
"test",
|
||||
"-a",
|
||||
"OutrightVanillaOrder"
|
||||
|
||||
@@ -63,7 +63,7 @@ struct IL3Reactor::Connection : public IL3Connection {
|
||||
if (result < 0) {
|
||||
auto er = errno;
|
||||
char msg[256];
|
||||
LOG(OrderMan, Error, "Failed to connect: {} {}:{}",
|
||||
LOG(iLink3, Error, "Failed to connect: {} {}:{}",
|
||||
std::string(strerror_r(er, msg, sizeof(msg))),host,port);
|
||||
disconnect();
|
||||
}
|
||||
@@ -92,7 +92,7 @@ struct IL3Reactor::Connection : public IL3Connection {
|
||||
|
||||
void send(const std::string_view data) override {
|
||||
if (!is_connected) {
|
||||
LOG(OrderMan, Error, "Attempted to send on closed connection. {}:{}", current_end_point().host, current_end_point().port);
|
||||
LOG(iLink3, Error, "Attempted to send on closed connection. {}:{}", current_end_point().host, current_end_point().port);
|
||||
return;
|
||||
}
|
||||
auto result = write(fd, data.data(), data.size());
|
||||
@@ -101,7 +101,7 @@ struct IL3Reactor::Connection : public IL3Connection {
|
||||
char msg[256];
|
||||
auto host = current_end_point().host;
|
||||
auto port = current_end_point().port;
|
||||
LOG(OrderMan, Warn, "Could not write to reactor connection. {}:{}",
|
||||
LOG(iLink3, Warn, "Could not write to reactor connection. {}:{}",
|
||||
std::string(strerror_r(er, msg, sizeof(msg))),host,port);
|
||||
disconnect();
|
||||
}
|
||||
@@ -109,7 +109,7 @@ struct IL3Reactor::Connection : public IL3Connection {
|
||||
|
||||
void send(const std::vector<std::string_view>& dt) override {
|
||||
if (!is_connected) {
|
||||
LOG(OrderMan, Error, "Attempted to send on closed connection. {}:{}", current_end_point().host, current_end_point().port);
|
||||
LOG(iLink3, Error, "Attempted to send on closed connection. {}:{}", current_end_point().host, current_end_point().port);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ struct IL3Reactor::Connection : public IL3Connection {
|
||||
char msg[256];
|
||||
auto host = current_end_point().host;
|
||||
auto port = current_end_point().port;
|
||||
LOG(OrderMan, Warn, "Could not write to reactor connection. {}:{}",
|
||||
LOG(iLink3, Warn, "Could not write to reactor connection. {}:{}",
|
||||
std::string(strerror_r(er, msg, sizeof(msg))),host,port);
|
||||
disconnect();
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ void ILinkGW::send_cancel(const CancelOrderMsg& cancel) {
|
||||
}
|
||||
|
||||
void ILinkGW::send_terminate(uint16_t code) {
|
||||
LOG(OrderMan, Info, "Terminate");
|
||||
LOG(iLink3, Info, "Terminate");
|
||||
auto msg = _buffer.frame<iLinkBinary::Terminate507>();
|
||||
msg.uUID(_session.uuid);
|
||||
msg.requestTimestamp(_time.now());
|
||||
@@ -365,7 +365,7 @@ log::CharPtrWrapper wstate_string(State s) { return wrap(state_string(s)); }
|
||||
|
||||
void ILinkGW::set_state(State s) {
|
||||
if (s != _x_state) {
|
||||
LOG(OrderMan, Info, "ILinkGW {}: {}->{}",
|
||||
LOG(iLink3, Info, "ILinkGW {}: {}->{}",
|
||||
_session.uuid, wstate_string(_x_state), wstate_string(s));
|
||||
_x_state = s;
|
||||
if (_on_state_change) _on_state_change(s);
|
||||
@@ -379,14 +379,14 @@ void ILinkGW::on_connect_success() {
|
||||
if (!_session) {
|
||||
// If we have a 0 cme_seq this is a new session and we need to negotiate it
|
||||
bts_assert(_session.uuid != 0);
|
||||
LOG(OrderMan, Info, "Negotiating new iLink session. {}", _session.uuid);
|
||||
LOG(iLink3, Info, "Negotiating new iLink session. {}", _session.uuid);
|
||||
set_state(State::NEGOTATING);
|
||||
send_negotiate();
|
||||
flush(false);
|
||||
}
|
||||
else {
|
||||
// We only need to establish the current sequence number
|
||||
LOG(OrderMan, Info, "re-establishing existing iLink session. {}", _session.uuid);
|
||||
LOG(iLink3, Info, "re-establishing existing iLink session. {}", _session.uuid);
|
||||
_session.to_cme = std::max(_session.to_cme, 1u);
|
||||
set_state(State::ESTABLISHING);
|
||||
send_establish();
|
||||
@@ -395,9 +395,9 @@ void ILinkGW::on_connect_success() {
|
||||
}
|
||||
|
||||
void ILinkGW::on_disconnect() {
|
||||
LOG(OrderMan, Error, "Disconnected.");
|
||||
LOG(iLink3, Error, "Disconnected.");
|
||||
if (_config.failover_on_disconnect) {
|
||||
LOG(OrderMan, Error, "Attempting failover");
|
||||
LOG(iLink3, Error, "Attempting failover");
|
||||
_connection.failover();
|
||||
connect();
|
||||
}
|
||||
@@ -407,7 +407,7 @@ void ILinkGW::on_disconnect() {
|
||||
}
|
||||
|
||||
void ILinkGW::enqueue_retransmit(uint32_t from, uint32_t to, uint64_t uuid) {
|
||||
LOG(OrderMan,Warn, "Prepare retransmit from: {} to: {}", from, to);
|
||||
LOG(iLink3,Warn, "Prepare retransmit from: {} to: {}", from, to);
|
||||
bts_assert(to >= from);
|
||||
do {
|
||||
// +1 because to/from are using an inclusive range
|
||||
@@ -426,7 +426,7 @@ void ILinkGW::begin_retransmit() {
|
||||
auto& working = _retransmit.front();
|
||||
// Don't pop the queue because we need to know when we're done
|
||||
auto count = working.to - working.from + 1;
|
||||
LOG(OrderMan,Warn, "Sending retransmit for missing packets: from: {} to: {} count: {}", working.from, working.to, count);
|
||||
LOG(iLink3,Warn, "Sending retransmit for missing packets: from: {} to: {} count: {}", working.from, working.to, count);
|
||||
bts_assert_d(count < Retransmit::MAX_RECOVERY);
|
||||
send_retransmit_request(working.uuid, working.from, count);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ void ILinkGW::begin_retransmit() {
|
||||
void ILinkGW::on_retransmit_complete() {
|
||||
// Replay is complete. Advance to go. Collect $200
|
||||
_retransmit.pop();
|
||||
LOG(OrderMan,Warn,"Retransmit complete");
|
||||
LOG(iLink3,Warn,"Retransmit complete");
|
||||
if (!_retransmit.empty()) {
|
||||
// More replay to do...
|
||||
begin_retransmit();
|
||||
@@ -470,7 +470,7 @@ void ILinkGW::handle(const iLinkBinary::NegotiationResponse501& msg) {
|
||||
}
|
||||
|
||||
void ILinkGW::handle(const iLinkBinary::NegotiationReject502& msg) {
|
||||
LOG(OrderMan, Error, "Negotiate Reject: {} '{}'.",
|
||||
LOG(iLink3, Error, "Negotiate Reject: {} '{}'.",
|
||||
msg.errorCodes(),
|
||||
std::string(translate_negotiation_reject(msg.errorCodes())));
|
||||
log_in(msg);
|
||||
@@ -515,7 +515,7 @@ void ILinkGW::handle(const iLinkBinary::EstablishmentAck504& msg) {
|
||||
}
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::EstablishmentReject505& msg) {
|
||||
LOG(OrderMan, Error, "Establishment Reject: {} '{}'. NextSeq: {}.",
|
||||
LOG(iLink3, Error, "Establishment Reject: {} '{}'. NextSeq: {}.",
|
||||
msg.errorCodes(),
|
||||
std::string(translate_establish_reject(msg.errorCodes())),
|
||||
msg.nextSeqNo());
|
||||
@@ -531,7 +531,7 @@ void ILinkGW::handle(const iLinkBinary::Sequence506& msg) {
|
||||
flush();
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::Terminate507& msg) {
|
||||
LOG(OrderMan, Error, "Terminated by exchange. Code: {} Reason: {}. \n {}",
|
||||
LOG(iLink3, Error, "Terminated by exchange. Code: {} Reason: {}. \n {}",
|
||||
msg.errorCodes(),
|
||||
wrap(msg.reason()),
|
||||
wrap("https://www.cmegroup.com/confluence/display/EPICSANDBOX/Terminate")
|
||||
@@ -553,7 +553,7 @@ void ILinkGW::handle(const iLinkBinary::Retransmission509& msg) {
|
||||
log_in(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::RetransmitReject510& msg) {
|
||||
LOG(OrderMan, Error, "Retransmit requeste rejected. {}", msg.getReasonAsString());
|
||||
LOG(iLink3, Error, "Retransmit requeste rejected. {}", msg.getReasonAsString());
|
||||
log_in(msg);
|
||||
set_state(State::ERROR);
|
||||
}
|
||||
@@ -566,7 +566,7 @@ void ILinkGW::handle(const iLinkBinary::PartyDetailsDefinitionRequestAck519& msg
|
||||
handle_common(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::BusinessReject521& msg) {
|
||||
LOG(OrderMan, Error, "Business Reject: {} '{}'.",
|
||||
LOG(iLink3, Error, "Business Reject: {} '{}'.",
|
||||
msg.businessRejectReason(),
|
||||
wrap(translate_business_reject_reason(msg.businessRejectReason())));
|
||||
handle_common(msg);
|
||||
@@ -581,7 +581,7 @@ void ILinkGW::handle(const iLinkBinary::ExecutionReportNew522& msg) {
|
||||
handle_common(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::ExecutionReportReject523& msg) {
|
||||
LOG(OrderMan, Error, "Execution report reject: {}", wrap(msg.text()));
|
||||
LOG(iLink3, Error, "Execution report reject: {}", wrap(msg.text()));
|
||||
handle_exe_report(msg);
|
||||
}
|
||||
void ILinkGW::handle(const iLinkBinary::ExecutionReportElimination524& msg) {
|
||||
|
||||
@@ -188,7 +188,7 @@ private:
|
||||
if (result) {
|
||||
_on_exe_report(report);
|
||||
}
|
||||
else { LOG(OrderMan, Error, "Failed to parse error report."); }
|
||||
else { LOG(iLink3, Error, "Failed to parse error report."); }
|
||||
handle_common(msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user