code: def encodeMsg(self, mesg):
          '''Get byts for a message'''
  
          fmt = self.locs.get('log:fmt')
          if fmt == 'jsonl':
              s = json.dumps(mesg, sort_keys=True) + '\n'
              buf = s.encode()
              return buf
  
          elif fmt == 'mpk':
              buf = s_msgpack.en(mesg)
              return buf
  
          mesg = f'Unknown encoding format: {fmt}'
          raise s_exc.SynErr(mesg=mesgf encodeMsg(self, mesg):
          '''Get byts for a message'''
  
          fmt = self.locs.get('log:fmt')
          if fmt == 'jsonl':
              s = json.dumps(mesg, sort_keys=True) + '\n'
              buf = s.encode()
              return buf
  
          elif fmt == 'mpk':
              buf = s_msgpack.en(mesg)
              return buf
  
          mesg = f'Unknown encoding format: {fmt}'
          raise s_exc.SynErr(mesg=mesg)
docs: Get byts for a message