From 2d321c8ca41e26456bb96c4c6b5612a44b408ff4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 7 Apr 2009 01:29:46 +0000 Subject: added log notice for key derivation role parameter --- src/keyDerivation.cpp | 1 + src/options.cpp | 10 ++++++++++ src/options.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/keyDerivation.cpp b/src/keyDerivation.cpp index 72a7fa4..cdf6368 100644 --- a/src/keyDerivation.cpp +++ b/src/keyDerivation.cpp @@ -54,6 +54,7 @@ void KeyDerivation::setRole(const role_t role) { WritersLock lock(mutex_); role_ = role; + cLog.msg(Log::PRIO_NOTICE) << "KeyDerivation: using role " << role_; } #ifndef NO_CRYPT diff --git a/src/options.cpp b/src/options.cpp index 7505eb5..82481c0 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -51,6 +51,16 @@ std::ostream& operator<<(std::ostream& stream, syntax_error const& error) return stream; } +std::ostream& operator<<(std::ostream& stream, role_t const& role) +{ + switch(role) { + case ROLE_LEFT: stream << "left"; break; + case ROLE_RIGHT: stream << "right"; break; + default: stream << "unknown"; break; + } + return stream; +} + void OptionHost::init(std::string addrPort) { std::string origAddrPort(addrPort); diff --git a/src/options.h b/src/options.h index f2d6619..6905d3b 100644 --- a/src/options.h +++ b/src/options.h @@ -78,6 +78,7 @@ std::istream& operator>>(std::istream& stream, OptionNetwork& network); typedef std::list StringList; typedef enum { ROLE_LEFT, ROLE_RIGHT } role_t; +std::ostream& operator<<(std::ostream& stream, role_t const& role); class Options { -- cgit v1.2.3