def log_event(event: MutableMapping[(str, Any)]) -> None:
    if (settings.EVENT_LOG_DIR is None):
        return
    if ('timestamp' not in event):
        event['timestamp'] = time.time()
    if (not os.path.exists(settings.EVENT_LOG_DIR)):
        os.mkdir(settings.EVENT_LOG_DIR)
    template = os.path.join(settings.EVENT_LOG_DIR, (('%s.' + platform.node()) + timezone_now().strftime('.%Y-%m-%d')))
    with lockfile((template % ('lock',))):
        with open((template % ('events',)), 'a') as log:
            log.write((ujson.dumps(event) + '\n'))
def log_event(event: MutableMapping[(str, Any)]) -> None:
    if (settings.EVENT_LOG_DIR is None):
        return
    if ('timestamp' not in event):
        event['timestamp'] = time.time()
    if (not os.path.exists(settings.EVENT_LOG_DIR)):
        os.mkdir(settings.EVENT_LOG_DIR)
    template = os.path.join(settings.EVENT_LOG_DIR, (('%s.' + platform.node()) + timezone_now().strftime('.%Y-%m-%d')))
    with lockfile((template % ('lock',))):
        with open((template % ('events',)), 'a') as log:
            log.write((ujson.dumps(event) + '\n'))