class_docstr: Logs actions/observations in a world and saves in a given format.
class_docstr_tok: ["Logs","actions\/observations","in","a","world","and","saves","in","a","given","format","."]
code: def write_parlai_format(self, outfile):
      logging.info(f"Saving log to {outfile} in ParlAI format")
      with PathManager.open(outfile, "w") as fw:
          for episode in tqdm(self._logs):
              ep = self.convert_to_labeled_data(episode)
              for act in ep:
                  txt = msg_to_str(act)
                  fw.write(txt + "\n")
              fw.write("\n")
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.worlds import BatchWorld, DynamicBatchWorld
  from parlai.utils.misc import msg_to_str
  from parlai.utils.conversations import Conversations
  from parlai.utils.io import PathManager
  import parlai.utils.logging
  from parlai.core.message import Message
  import copy
  from tqdm import tqdm
label_desc: Use image node_id 13 for calling the WorldLogger obj's underlying member method code with example usage: obj.write_parlai_format(outfile) without return types