File size: 320 Bytes
796fad1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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