0
import time
class FileLogger:
    filename = "log.txt"
    def write_message(self, message):
        # Append message to log file.
        with open(self.filename, "a") as outfile:
            line = "{} {}\n".format(int(time.time()), message)
            outfile.write(line)

I'm getting the following error message... why?
  IndentationError: unindent does not match any outer indentation level

1 Answers1

0

This kind of error is probably because of mixing spaces and tabs for indentation. Try to be consistent with the method of indentation (only tabs or only spaces). This answer should help: IndentationError: unindent does not match any outer indentation level