import sys
import datetime
import threading
import threading

stderr_lock = threading.Lock()

def log(message):
    stderr_lock.acquire()
    sys.stderr.write(str(datetime.datetime.now()) + ': ' + message + '\n')
    stderr_lock.release()
