<?php

namespace Itgalaxy\Elementor\Form\Infusionsoft\Integration\Admin;

use Itgalaxy\Elementor\Form\Infusionsoft\Integration\Includes\Bootstrap;

class LogHelper
{
    public function __construct()
    {
        if (!current_user_can('manage_options')) {
            return;
        }

        if (isset($_GET[Bootstrap::OPTIONS_KEY . '-logs-get'])) {
            add_action('admin_init', [$this, 'logsGet']);
        }
    }

    /**
     * @return void
     */
    public function logsGet()
    {
        Bootstrap::$common->logger->logsGet();
    }
}
