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 <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>private/kendy/tilesandcallbacks
parent
b0f20ea35f
commit
74f796d91a
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue