From 12b7c9b8eac173e326b63a71c890229cd39920e8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 21 Aug 2013 01:00:23 +0000 Subject: Allow getting the name of the current phase of a BackupStoreContext. Useful for debugging when the phase is not as expected. --- lib/backupstore/BackupStoreContext.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/backupstore') diff --git a/lib/backupstore/BackupStoreContext.h b/lib/backupstore/BackupStoreContext.h index c2fe14ff..c33e7d50 100644 --- a/lib/backupstore/BackupStoreContext.h +++ b/lib/backupstore/BackupStoreContext.h @@ -66,6 +66,19 @@ public: }; int GetPhase() const {return mProtocolPhase;} + std::string GetPhaseName() const + { + switch(mProtocolPhase) + { + case Phase_Version: return "Phase_Version"; + case Phase_Login: return "Phase_Login"; + case Phase_Commands: return "Phase_Commands"; + default: + std::ostringstream oss; + oss << "Unknown phase " << mProtocolPhase; + return oss.str(); + } + } void SetPhase(int NewPhase) {mProtocolPhase = NewPhase;} // Read only locking -- cgit v1.2.3