Make debug logging functions pure virtual on the transaction interfaces. Rename the function on TraceEvent to be more generic.
This commit is contained in:
parent
cb66a76d80
commit
87ac857aeb
|
@ -488,6 +488,14 @@ void DLTransaction::reset() {
|
|||
api->transactionReset(tr);
|
||||
}
|
||||
|
||||
void DLTransaction::debugTrace(BaseTraceEvent&& event) {
|
||||
event.detail("CommitResult", "Deferred logging unsupported").log();
|
||||
};
|
||||
|
||||
void DLTransaction::debugPrint(std::string const& message) {
|
||||
fmt::print("[Deferred logging unsupported] {}\n", message);
|
||||
}
|
||||
|
||||
ThreadFuture<VersionVector> DLTransaction::getVersionVector() {
|
||||
return VersionVector(); // not implemented
|
||||
}
|
||||
|
|
|
@ -142,10 +142,8 @@ public:
|
|||
|
||||
virtual Optional<TenantName> getTenant() = 0;
|
||||
|
||||
virtual void debugTrace(BaseTraceEvent&& event) {
|
||||
event.detail("CommitResult", "Deferred logging unsupported").log();
|
||||
};
|
||||
virtual void debugPrint(std::string const& message) { fmt::print("[Deferred logging unsupported] {}\n", message); }
|
||||
virtual void debugTrace(BaseTraceEvent&& event) = 0;
|
||||
virtual void debugPrint(std::string const& message) = 0;
|
||||
|
||||
template <class... Args>
|
||||
void debugFmtPrint(std::string const& message, Args&&... args) {
|
||||
|
|
|
@ -82,4 +82,12 @@ public:
|
|||
|
||||
// Implemented:
|
||||
void getWriteConflicts(KeyRangeMap<bool>* result) override{};
|
||||
|
||||
void debugTrace(BaseTraceEvent&& event) override {
|
||||
event.detail("CommitResult", "Deferred logging unsupported").log();
|
||||
};
|
||||
|
||||
virtual void debugPrint(std::string const& message) override {
|
||||
fmt::print("[Deferred logging unsupported] {}\n", message);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -113,10 +113,8 @@ public:
|
|||
virtual void checkDeferredError() const = 0;
|
||||
virtual void getWriteConflicts(KeyRangeMap<bool>* result) = 0;
|
||||
|
||||
virtual void debugTrace(BaseTraceEvent&& event) {
|
||||
event.detail("CommitResult", "Deferred logging unsupported").log();
|
||||
};
|
||||
virtual void debugPrint(std::string const& message) { fmt::print("[Deferred logging unsupported] {}\n", message); }
|
||||
virtual void debugTrace(BaseTraceEvent&& event) = 0;
|
||||
virtual void debugPrint(std::string const& message) = 0;
|
||||
|
||||
template <class... Args>
|
||||
void debugFmtPrint(std::string const& message, Args&&... args) {
|
||||
|
|
|
@ -554,6 +554,9 @@ public:
|
|||
throw internal_error();
|
||||
}
|
||||
|
||||
void debugTrace(BaseTraceEvent&& event) override;
|
||||
void debugPrint(std::string const& message) override;
|
||||
|
||||
void addref() override { ThreadSafeReferenceCounted<DLTransaction>::addref(); }
|
||||
void delref() override { ThreadSafeReferenceCounted<DLTransaction>::delref(); }
|
||||
|
||||
|
|
|
@ -415,17 +415,17 @@ public:
|
|||
const TraceEventFields& getFields() const { return fields; }
|
||||
|
||||
template <class Transaction>
|
||||
void moveToTransaction(Transaction& tr) {
|
||||
void moveTo(Transaction& tr) {
|
||||
tr.debugTrace(std::move(*this));
|
||||
}
|
||||
|
||||
template <class Transaction>
|
||||
void moveToTransaction(Reference<Transaction> tr) {
|
||||
void moveTo(Reference<Transaction> tr) {
|
||||
tr->debugTrace(std::move(*this));
|
||||
}
|
||||
|
||||
template <class Transaction>
|
||||
void moveToTransaction(Transaction* tr) {
|
||||
void moveTo(Transaction* tr) {
|
||||
tr->debugTrace(std::move(*this));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue