from os import error
from datetime import datetime


def format_error(e):
    return f'\n{datetime.now()}: {repr(e)}'


def log(e):
    try:
        with open('log.txt', 'a') as f:
            f.write(format_error(e))
    except IOError as e:
        print(e)
    except e:
        print(e)

d205979c2cfeb2140dc0f14da26d7f83f290285b
<mask token>

<mask token>


def format_error(e):
    return f'\n{datetime.now()}: {repr(e)}'


<mask token>

<mask token>


def format_error(e):
    return f'\n{datetime.now()}: {repr(e)}'


def log(e):
    try:
        with open('log.txt', 'a') as f:
            f.write(format_error(e))
    except IOError as e:
        print(e)
    except e:
        print(e)

from os import error
from datetime import datetime


def format_error(e):
    return f'\n{datetime.now()}: {repr(e)}'


def log(e):
    try:
        with open('log.txt', 'a') as f:
            f.write(format_error(e))
    except IOError as e:
        print(e)
    except e:
        print(e)
