0

I'm looking for some as simple as possible option to do logging in Python.

Now, I have to do things like this:

def log(text):
    now = datetime.now().strftime('%d.%m.%Y %H:%M:%S')
    _lock.acquire() # In case that I call methods in Pool
    printToFile('logging/log.log', '{} -> {}'.format(now, text))
    _lock.release()

And call this function before each method I want to be logged. I'm not looking for decorator.

Do you have any advices?

The log file would be a txt file with timetable of called methods during the execution.

Milano
  • 18,048
  • 37
  • 153
  • 353

0 Answers0