def pretty_emit(self, record, is_header=False, task_level=None):
task = record.task or self.cur_task<EOL>if task_level is None:<EOL><INDENT>task_level = self.cur_depth_level<EOL><DEDENT>if is_header:<EOL><INDENT>extra_prefix = (<EOL>self.get_task_indicator(task_level - <NUM_LIT:1>) + '<STR_LIT:U+0020>' +<EOL>('<STR_LIT>' if self.am_i_main_thread else '<STR_LIT>' % self.cur_thread) +<EOL>task + '<STR_LIT>'<EOL>)<EOL>record.levelno = logging.INFO<EOL><DEDENT>else:<EOL><INDENT>extra_prefix = '<STR_LIT:U+0020>' + self.get_task_indicator(task_level) + '<STR_LIT:U+0020>'<EOL><DEDENT>if task:<EOL><INDENT>record.msg = (<EOL>'<STR_LIT:U+0020>' * (task_level - <NUM_LIT:1>) + extra_prefix + str(record.msg)<EOL>)<EOL><DEDENT>super().emit(record)<EOL>super().flush()<EOL>
Wrapper around the :class:`logging.StreamHandler` emit method to add
some decoration stuff to the message

Args:
    record (logging.LogRecord): log record to emit
    is_header (bool): if this record is a header, usually, a start or
        end task message
    task_level (int): If passed, will take that as the current nested
        task level instead of calculating it from the current tasks

Returns:
    None