"""Logging operations for lumi2."""

import logging as l
from time import strftime

from flask import request


def log_request(response):
    logger = l.getLogger('lumi2')

    timestamp = strftime('[%Y-%b-%d %H:%M]')
    logger.info(f"{timestamp} {request.remote_addr} {request.method} {request.scheme} {request.full_path} {response.status_code}")

    return response
