]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
logclient: optionally take a stringstream
authorSage Weil <sage@newdream.net>
Thu, 4 Dec 2008 21:01:19 +0000 (13:01 -0800)
committerSage Weil <sage@newdream.net>
Thu, 4 Dec 2008 21:01:19 +0000 (13:01 -0800)
src/common/LogClient.cc
src/common/LogClient.h

index f4f043b18db787286a195f6f94e085b525c86288..ee5d0bf18002cda2dcf08d135f0be41809b3f8aa 100644 (file)
 
 #include "config.h"
 
-void LogClient::log(log_type type, string s)
+void LogClient::log(log_type type, stringstream& ss)
+{
+  while (!ss.eof()) {
+    string s;
+    getline(ss, s);
+    log(type, s);
+  }
+}
+
+void LogClient::log(log_type type, string& s)
 {
   Mutex::Locker l(log_lock);
   dout(10) << "log " << (log_type)type << " : " << s << dendl;
index 084ec5eae9d2114fd451dde07f10f2bc8b35ee40..d5f49147b6b7ec216c542bab81466767baa4c357 100644 (file)
@@ -20,6 +20,8 @@
 #include "common/Mutex.h"
 #include "include/LogEntry.h"
 
+#include <sstream>
+
 class Messenger;
 class MLog;
 class MonMap;
@@ -35,7 +37,8 @@ class LogClient {
   deque<LogEntry> log_queue;
   version_t last_log;
 
-  void log(log_type type, string s);
+  void log(log_type type, string& s);
+  void log(log_type type, stringstream& s);
   void send_log();
   void handle_log(MLog *m);