def _compress(self, input_str):
compressed_bits = cStringIO.StringIO()<EOL>f = gzip.GzipFile(fileobj=compressed_bits, mode='<STR_LIT:wb>')<EOL>f.write(input_str)<EOL>f.close()<EOL>return compressed_bits.getvalue()<EOL>
Compress the log message in order to send less bytes to the wire.