Skip to content

Commit

Permalink
better debug logging: use repr_ellipsized after converting to string,…
Browse files Browse the repository at this point in the history
… but only do that if debug is enabled as this is expensive

git-svn-id: https://xpra.org/svn/Xpra/trunk@22823 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 1, 2019
1 parent b1f63d7 commit 6c9c1f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/xpra/clipboard/clipboard_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ def _process_clipboard_contents(self, packet):
dtype = bytestostr(dtype)
log("process clipboard contents, selection=%s, type=%s, format=%s", selection, dtype, dformat)
raw_data = self._munge_wire_selection_to_raw(wire_encoding, dtype, dformat, wire_data)
log("clipboard wire -> raw: %r -> %r", (dtype, dformat, wire_encoding, wire_data), raw_data)
if log.is_debug_enabled():
def r(x):
return repr_ellipsized(str(x))
log("clipboard wire -> raw: %s -> %s", (dtype, dformat, wire_encoding, r(wire_data)), r(raw_data))
self._clipboard_got_contents(request_id, dtype, dformat, raw_data)

def _process_clipboard_contents_none(self, packet):
Expand Down

0 comments on commit 6c9c1f3

Please sign in to comment.