]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
debug.h: cleanup includes
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 18 Feb 2011 15:35:23 +0000 (07:35 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 18 Feb 2011 15:36:06 +0000 (07:36 -0800)
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 <colin.mccabe@dreamhost.com>
src/common/debug.h
src/common/hex.cc
src/include/assert.h

index d0deb37af2b732c82f56a80e5c294507c47c896e..0e01534d458defcc63a873f6f65b058970bc77b7 100644 (file)
 #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 <iosfwd>
-#include <string>
+#include <iostream>
+#include <pthread.h>
+#include <streambuf>
+
+template <typename T, typename U>
+class DoutStreambuf;
 
 extern std::ostream *_dout;
-extern DoutStreambuf <char> *_doss;
+extern DoutStreambuf <char, std::basic_string<char>::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 << " ";
index 114318c79a68b94263fc1ba9a9fc62aefda5b3fb..c01fb35ae3edbe8a7d31457bacd931e42a86f161 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include "config.h"
 #include "common/debug.h"
 #include "common/hex.h"
 
index ddbfe5bea212a854525a00a1820936a06fe12bde..98199b876447021d3cfa8917dd76ea99117dba2b 100644 (file)
@@ -98,6 +98,9 @@ extern void __ceph_assert_warn(const char *assertion, const char *file, int line
 
 #ifdef __cplusplus
 }
+
+using namespace ceph;
+
 #endif
 
 /*