loolwsd/TraceFile.hpp  |    7 +++++++
 loolwsd/loolwsd.xml.in |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 74f796d91ab2871ad8da9025a59a8449dc4375fb
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Mon Sep 19 18:48:30 2016 -0400

    loolwsd: flush trace file on events
    
    This reduces chances of data loss and gives
    more up-to-date data to the user.
    
    Also include tile messages in the trace recording,
    since they are useful for debugging. Should be
    disabled to reduce excessive trace generation.
    
    Change-Id: I223144660698843f4e94564e049883db898c0064
    Reviewed-on: https://gerrit.libreoffice.org/29060
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/TraceFile.hpp b/loolwsd/TraceFile.hpp
index 576121f..8c32d47 100644
--- a/loolwsd/TraceFile.hpp
+++ b/loolwsd/TraceFile.hpp
@@ -71,6 +71,7 @@ public:
     void writeEvent(const std::string& pId, const std::string& sessionId, 
const std::string& data)
     {
         write(pId, sessionId, data, 
static_cast<char>(TraceFileRecord::Direction::Event));
+        flush();
     }
 
     void writeIncoming(const std::string& pId, const std::string& sessionId, 
const std::string& data)
@@ -89,6 +90,12 @@ public:
         }
     }
 
+    void flush()
+    {
+        _deflater.flush();
+        _stream.flush();
+    }
+
 private:
     void write(const std::string& pId, const std::string& sessionId, const 
std::string& data, const char delim)
     {
diff --git a/loolwsd/loolwsd.xml.in b/loolwsd/loolwsd.xml.in
index 56de388..20b1dd7 100644
--- a/loolwsd/loolwsd.xml.in
+++ b/loolwsd/loolwsd.xml.in
@@ -36,7 +36,7 @@
     <trace desc="Dump commands and notifications for replay" enable="true">
         <path desc="Output file path" compress="true">/tmp/looltrace.gz</path>
         <filter>
-            <message desc="Regex pattern of messages to 
exclude">tile.*</message>
+            <message desc="Regex pattern of messages to exclude"></message>
         </filter>
         <outgoing>
             <record desc="Whether or not to record outgoing messages" 
default="false">false</record>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to