#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 fx-kirin <fx.kirin@gmail.com>
#
# Distributed under terms of the MIT license.

"""

"""

import logging
import os
from pathlib import Path

import fire
import kanilog
import stdlogging

from periodical_requests_recorder import RequestsRecorder


def main(yaml_path):
    rec = RequestsRecorder()
    rec.load_yaml(yaml_path)
    rec.start()


if __name__ == "__main__":
    kanilog.setup_logger(
        logfile="/tmp/%s.log" % (Path(__file__).name), level=logging.INFO
    )
    stdlogging.enable()
    fire.Fire(main)
