From 5ac581df0265976f895e874aa70080b1ee89adbd Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Mon, 6 Dec 2010 15:50:44 -0800 Subject: [PATCH] Rename SyslogStreambuf -> DoutStreambuf Signed-off-by: Colin McCabe --- src/Makefile.am | 10 +++++----- .../{SyslogStreambuf.cc => DoutStreambuf.cc} | 20 +++++++++---------- .../{SyslogStreambuf.h => DoutStreambuf.h} | 12 +++++------ ...yslogStreambuf.cc => TestDoutStreambuf.cc} | 10 +++++----- 4 files changed, 26 insertions(+), 26 deletions(-) rename src/common/{SyslogStreambuf.cc => DoutStreambuf.cc} (83%) rename src/common/{SyslogStreambuf.h => DoutStreambuf.h} (83%) rename src/test/{TestSyslogStreambuf.cc => TestDoutStreambuf.cc} (85%) diff --git a/src/Makefile.am b/src/Makefile.am index d0d650a35cac5..94982ca0e2d1a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -193,9 +193,9 @@ testencoding_SOURCES = test/TestEncoding.cc testencoding_LDADD = libceph.la libcrush.la -lpthread -lm -lcrypto bin_PROGRAMS += testencoding -testsyslog_streambuf_SOURCES = test/TestSyslogStreambuf.cc -testsyslog_streambuf_LDADD = libceph.la libcrush.la -lpthread -bin_PROGRAMS += testsyslog_streambuf +testdout_streambuf_SOURCES = test/TestDoutStreambuf.cc +testdout_streambuf_LDADD = libceph.la libcrush.la -lpthread +bin_PROGRAMS += testdout_streambuf endif @@ -452,7 +452,7 @@ libcommon_files = \ config.cc \ common/page.cc \ common/lockdep.cc \ - common/SyslogStreambuf.cc + common/DoutStreambuf.cc libcrush_a_SOURCES = \ crush/builder.c \ @@ -585,7 +585,7 @@ noinst_HEADERS = \ common/Mutex.h\ common/RWLock.h\ common/Semaphore.h\ - common/SyslogStreambuf.h\ + common/DoutStreambuf.h\ common/Thread.h\ common/Throttle.h\ common/Timer.h\ diff --git a/src/common/SyslogStreambuf.cc b/src/common/DoutStreambuf.cc similarity index 83% rename from src/common/SyslogStreambuf.cc rename to src/common/DoutStreambuf.cc index 7c30c4f26b8f8..ca75af11d39db 100644 --- a/src/common/SyslogStreambuf.cc +++ b/src/common/DoutStreambuf.cc @@ -12,7 +12,7 @@ * */ -#include "common/SyslogStreambuf.h" +#include "common/DoutStreambuf.h" #include #include @@ -22,7 +22,7 @@ #include template -SyslogStreambuf::SyslogStreambuf() +DoutStreambuf::DoutStreambuf() { // Initialize get pointer to zero so that underflow is called on the first read. this->setg(0, 0, 0); @@ -39,8 +39,8 @@ SyslogStreambuf::SyslogStreambuf() // In this function, the buffer should be written to wherever it should // be written to (in this case, the streambuf object that this is controlling). template -typename SyslogStreambuf::int_type -SyslogStreambuf::overflow(SyslogStreambuf::int_type c) +typename DoutStreambuf::int_type +DoutStreambuf::overflow(DoutStreambuf::int_type c) { charT* end = this->pptr(); @@ -68,8 +68,8 @@ SyslogStreambuf::overflow(SyslogStreambuf::int_typ // This is called to flush the buffer. // This is called when we're done with the file stream (or when .flush() is called). template -typename SyslogStreambuf::int_type -SyslogStreambuf::sync() +typename DoutStreambuf::int_type +DoutStreambuf::sync() { //std::cout << "flush!" << std::endl; @@ -77,7 +77,7 @@ SyslogStreambuf::sync() if (obuf[0] == '\0') return 0; - typename SyslogStreambuf::int_type + typename DoutStreambuf::int_type ret(this->overflow(traits_ty::eof())); if (ret == traits_ty::eof()) return -1; @@ -86,8 +86,8 @@ SyslogStreambuf::sync() } template -typename SyslogStreambuf::int_type -SyslogStreambuf::underflow() +typename DoutStreambuf::int_type +DoutStreambuf::underflow() { // We can't read from this // TODO: some more elegant way of preventing callers from trying to get input from this stream @@ -95,4 +95,4 @@ SyslogStreambuf::underflow() } // Explicit template instantiation -template class SyslogStreambuf ; +template class DoutStreambuf ; diff --git a/src/common/SyslogStreambuf.h b/src/common/DoutStreambuf.h similarity index 83% rename from src/common/SyslogStreambuf.h rename to src/common/DoutStreambuf.h index c55db5cdece22..c808b1b4a1157 100644 --- a/src/common/SyslogStreambuf.h +++ b/src/common/DoutStreambuf.h @@ -13,17 +13,17 @@ */ /* - * SyslogStreambuf + * DoutStreambuf * - * A stream buffer that writes its output to syslog. + * The stream buffer used by dout */ -#ifndef CEPH_SYSLOG_STREAMBUF_H -#define CEPH_SYSLOG_STREAMBUF_H +#ifndef CEPH_DOUT_STREAMBUF_H +#define CEPH_DOUT_STREAMBUF_H #include template > -class SyslogStreambuf : public std::basic_streambuf +class DoutStreambuf : public std::basic_streambuf { public: typedef traits traits_ty; @@ -34,7 +34,7 @@ public: // The size of the input and output buffers. static const size_t OBUF_SZ = 32000; - SyslogStreambuf(); + DoutStreambuf(); protected: // Called when the buffer fills up diff --git a/src/test/TestSyslogStreambuf.cc b/src/test/TestDoutStreambuf.cc similarity index 85% rename from src/test/TestSyslogStreambuf.cc rename to src/test/TestDoutStreambuf.cc index cd6469d8d2fe5..758c3cfaba4e5 100644 --- a/src/test/TestSyslogStreambuf.cc +++ b/src/test/TestDoutStreambuf.cc @@ -13,12 +13,12 @@ */ /* - * TestSyslogStreambuf + * TestDoutStreambuf * - * Puts some output into the SyslogStreambuf class. + * Puts some output into the DoutStreambuf class. * Check your syslog to see what it did. */ -#include "common/SyslogStreambuf.h" +#include "common/DoutStreambuf.h" #include "common/common_init.h" #include "config.h" @@ -40,9 +40,9 @@ int main(int argc, const char **argv) common_set_defaults(false); common_init(args, "ceph", true); - std::ostream oss(new SyslogStreambuf); + std::ostream oss(new DoutStreambuf); - oss << "I am logging to syslog now!" << std::endl; + oss << "I am logging to dout now!" << std::endl; oss << "And here is another line!" << std::endl; -- 2.39.5