summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keyDerivation.cpp1
-rw-r--r--src/options.cpp10
-rw-r--r--src/options.h1
3 files changed, 12 insertions, 0 deletions
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<std::string> StringList;
typedef enum { ROLE_LEFT, ROLE_RIGHT } role_t;
+std::ostream& operator<<(std::ostream& stream, role_t const& role);
class Options
{