<?php
declare(strict_types=1);

namespace PayPo\Payment\Logger;

use Monolog\Logger as MonologLogger;

/**
 * Dedicated PayPo logger channel, configured in etc/di.xml.
 */
class Logger extends MonologLogger
{
    /**
     * Log a message at the INFO level.
     *
     * Kept as a named method because it is used throughout the module; Monolog
     * dropped its own addInfo() in 2.0, so it simply forwards to info().
     *
     * @param string $message
     * @param array $context
     * @return void
     */
    public function addInfo($message, array $context = []): void
    {
        $this->info((string)$message, $context);
    }

    /**
     * Log a message at the ERROR level.
     *
     * @param string $message
     * @param array $context
     * @return void
     */
    public function addError($message, array $context = []): void
    {
        $this->error((string)$message, $context);
    }
}
