code-as-policies / md_logger.py
jackyliang42's picture
working logging, readme
47097db
raw
history blame
320 Bytes
class MarkdownLogger:
def __init__(self):
self._log = ''
def log_text(self, text):
self._log += '\n' + text + '\n'
def log_code(self, code):
self._log += f'\n```python\n{code}\n```\n'
def clear(self):
self._log = ''
def get_log(self):
return self._log