BIND 10 trac1704_2, updated. 1d5bd47c50ca03b87972977bb3bdd8d798148698 [1704] Add documentation for setInterprocessSync()
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri May 25 04:33:13 UTC 2012
The branch, trac1704_2 has been updated
via 1d5bd47c50ca03b87972977bb3bdd8d798148698 (commit)
via 328f8781d99bdf1c78abbee743b85244ac55f6b8 (commit)
via 16fc37014cf72d8ca5b3f9461504be2c69a37702 (commit)
from d575fbaa4083182e8d6602bb042934451ae06c65 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1d5bd47c50ca03b87972977bb3bdd8d798148698
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri May 25 10:03:01 2012 +0530
[1704] Add documentation for setInterprocessSync()
commit 328f8781d99bdf1c78abbee743b85244ac55f6b8
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri May 25 10:02:36 2012 +0530
[1704] In case NULL is passed as the sync object, do nothing and return
commit 16fc37014cf72d8ca5b3f9461504be2c69a37702
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri May 25 09:54:03 2012 +0530
[1704] Move code to different places (no functional changes)
-----------------------------------------------------------------------
Summary of changes:
src/lib/log/logger.cc | 14 +++++++-------
src/lib/log/logger.h | 19 +++++++++++++------
src/lib/log/logger_impl.cc | 21 +++++++++++++--------
src/lib/log/logger_impl.h | 19 +++++++++++++------
4 files changed, 46 insertions(+), 27 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/log/logger.cc b/src/lib/log/logger.cc
index 7f434d4..fef5627 100644
--- a/src/lib/log/logger.cc
+++ b/src/lib/log/logger.cc
@@ -73,13 +73,6 @@ Logger::getEffectiveSeverity() {
return (getLoggerPtr()->getEffectiveSeverity());
}
-// Replace the interprocess synchronization object
-
-void
-Logger::setInterprocessSync(isc::util::InterprocessSync* sync) {
- getLoggerPtr()->setInterprocessSync(sync);
-}
-
// Debug level (only relevant if messages of severity DEBUG are being logged).
int
@@ -186,6 +179,13 @@ Logger::fatal(const isc::log::MessageID& ident) {
}
}
+// Replace the interprocess synchronization object
+
+void
+Logger::setInterprocessSync(isc::util::InterprocessSync* sync) {
+ getLoggerPtr()->setInterprocessSync(sync);
+}
+
// Comparison (testing only)
bool
diff --git a/src/lib/log/logger.h b/src/lib/log/logger.h
index e579f87..77be7ef 100644
--- a/src/lib/log/logger.h
+++ b/src/lib/log/logger.h
@@ -179,12 +179,6 @@ public:
/// is the severity of the parent.
virtual isc::log::Severity getEffectiveSeverity();
- /// \brief Replace the interprocess synchronization object
- ///
- /// \param sync The logger uses this synchronization object for
- /// synchronizing output of log messages.
- void setInterprocessSync(isc::util::InterprocessSync* sync);
-
/// \brief Return DEBUG Level
///
/// \return Current setting of debug level. This is returned regardless of
@@ -244,6 +238,19 @@ public:
/// \param ident Message identification.
Formatter fatal(const MessageID& ident);
+ /// \brief Replace the interprocess synchronization object
+ ///
+ /// This method is exception-free. If this method is called with
+ /// NULL as the argument, it does nothing and the old sync object is
+ /// used as before.
+ ///
+ /// \param sync The logger uses this synchronization object for
+ /// synchronizing output of log messages. If NULL is passed, the old
+ /// synchronization object is used as before. When a non-NULL sync
+ /// object is passed, it should be deletable and the ownership is
+ /// transferred to the logger.
+ void setInterprocessSync(isc::util::InterprocessSync* sync);
+
/// \brief Equality
///
/// Check if two instances of this logger refer to the same stream.
diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc
index 16b4d52..88e23d6 100644
--- a/src/lib/log/logger_impl.cc
+++ b/src/lib/log/logger_impl.cc
@@ -76,14 +76,6 @@ LoggerImpl::getSeverity() {
return level.severity;
}
-// Replace the interprocess synchronization object
-
-void
-LoggerImpl::setInterprocessSync(isc::util::InterprocessSync* sync) {
- delete sync_;
- sync_ = sync;
-}
-
// Return current debug level (only valid if current severity level is DEBUG).
int
LoggerImpl::getDebugLevel() {
@@ -115,6 +107,19 @@ LoggerImpl::lookupMessage(const MessageID& ident) {
MessageDictionary::globalDictionary().getText(ident)));
}
+// Replace the interprocess synchronization object
+
+void
+LoggerImpl::setInterprocessSync(isc::util::InterprocessSync* sync) {
+ // If we are passed NULL, change nothing. The old sync_ object will
+ // continue to be used.
+ if (sync == NULL)
+ return;
+
+ delete sync_;
+ sync_ = sync;
+}
+
void
LoggerImpl::outputRaw(const Severity& severity, const string& message) {
// Use an interprocess sync locker for mutual exclusion from other
diff --git a/src/lib/log/logger_impl.h b/src/lib/log/logger_impl.h
index e7f02af..43d8aa2 100644
--- a/src/lib/log/logger_impl.h
+++ b/src/lib/log/logger_impl.h
@@ -110,12 +110,6 @@ public:
virtual Severity getEffectiveSeverity();
- /// \brief Replace the interprocess synchronization object
- ///
- /// \param sync The logger uses this synchronization object for
- /// synchronizing output of log messages.
- void setInterprocessSync(isc::util::InterprocessSync* sync);
-
/// \brief Return debug level
///
/// \return Current setting of debug level. This will be zero if the
@@ -175,6 +169,19 @@ public:
/// This gets you the unformatted text of message for given ID.
std::string* lookupMessage(const MessageID& id);
+ /// \brief Replace the interprocess synchronization object
+ ///
+ /// This method is exception-free. If this method is called with
+ /// NULL as the argument, it does nothing and the old sync object is
+ /// used as before.
+ ///
+ /// \param sync The logger uses this synchronization object for
+ /// synchronizing output of log messages. If NULL is passed, the old
+ /// synchronization object is used as before. When a non-NULL sync
+ /// object is passed, it should be deletable and the ownership is
+ /// transferred to the logger implementation.
+ void setInterprocessSync(isc::util::InterprocessSync* sync);
+
/// \brief Equality
///
/// Check if two instances of this logger refer to the same stream.
More information about the bind10-changes
mailing list