From 5db1e50db317fd6c3929ce27d23a0be92677ae5c Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Fri, 18 Feb 2011 07:35:23 -0800 Subject: [PATCH] debug.h: cleanup includes Shouldn't need to include DoutStreambuf.h; that's all implementation. Don't include Mutex.h, since we don't use it. *Do* include config.h, since we need it. Signed-off-by: Colin McCabe --- src/common/debug.h | 20 ++++++++++++++------ src/common/hex.cc | 1 - src/include/assert.h | 3 +++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/common/debug.h b/src/common/debug.h index d0deb37af2b7..0e01534d458d 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -16,16 +16,19 @@ #ifndef CEPH_DEBUG_H #define CEPH_DEBUG_H -#include "Mutex.h" -#include "common/DoutStreambuf.h" #include "common/likely.h" +#include "config.h" // need for g_conf #include "include/assert.h" -#include -#include +#include +#include +#include + +template +class DoutStreambuf; extern std::ostream *_dout; -extern DoutStreambuf *_doss; +extern DoutStreambuf ::traits_type> *_doss; extern bool _dout_need_open; extern pthread_mutex_t _dout_lock; @@ -35,6 +38,10 @@ extern int dout_handle_daemonize(); extern int dout_create_rank_symlink(int n); +extern void dout_emergency(const char * const str); + +extern void dout_emergency(const std::string &str); + class DoutLocker { public: @@ -51,7 +58,8 @@ static inline void _dout_begin_line(signed int prio) { _dout_open_log(); // Put priority information into dout - _doss->sputc(prio + 12); + std::streambuf *doss = (std::streambuf*)_doss; + doss->sputc(prio + 12); // Some information that goes in every dout message *_dout << std::hex << pthread_self() << std::dec << " "; diff --git a/src/common/hex.cc b/src/common/hex.cc index 114318c79a68..c01fb35ae3ed 100644 --- a/src/common/hex.cc +++ b/src/common/hex.cc @@ -12,7 +12,6 @@ * */ -#include "config.h" #include "common/debug.h" #include "common/hex.h" diff --git a/src/include/assert.h b/src/include/assert.h index ddbfe5bea212..98199b876447 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -98,6 +98,9 @@ extern void __ceph_assert_warn(const char *assertion, const char *file, int line #ifdef __cplusplus } + +using namespace ceph; + #endif /* -- 2.47.3