<commit_before><?php

namespace FOQ\ElasticaBundle\Doctrine;

use FOQ\ElasticaBundle\Persister\ObjectPersister;
use Symfony\Component\HttpKernel\Log\LoggerInterface;

abstract class AbstractListener
{
    /**
     * Object persister
     *
     * @var ObjectPersister
     */
    protected $objectPersister;

    /**
     * Class of the domain model
     *
     * @var string
     */
    protected $objectClass;

    /**
     * List of subscribed events
     *
     * @var array
     */
    protected $events;

    protected $logger;

    /**
     * Constructor
     **/
    public function __construct(ObjectPersister $objectPersister, $objectClass, array $events, LoggerInterface $logger = null)
    {
        $this->objectPersister = $objectPersister;
        $this->objectClass     = $objectClass;
        $this->events          = $events;
        $this->logger          = $logger;
    }

    /**
     * @return array
     */
    public function getSubscribedEvents()
    {
        return $this->events;
    }

    /**
     * Log the failure message if a logger is available
     *
     * $param string $message
     */
    protected function logFailure($message)
    {
        if (null !== $this->logger) {
            $this->logger->err(sprintf('%s: %s', get_class($this), $message));
        }
    }
}<commit_msg>Change listener failure logging level to warn.<commit_after><?php

namespace FOQ\ElasticaBundle\Doctrine;

use FOQ\ElasticaBundle\Persister\ObjectPersister;
use Symfony\Component\HttpKernel\Log\LoggerInterface;

abstract class AbstractListener
{
    /**
     * Object persister
     *
     * @var ObjectPersister
     */
    protected $objectPersister;

    /**
     * Class of the domain model
     *
     * @var string
     */
    protected $objectClass;

    /**
     * List of subscribed events
     *
     * @var array
     */
    protected $events;

    protected $logger;

    /**
     * Constructor
     **/
    public function __construct(ObjectPersister $objectPersister, $objectClass, array $events, LoggerInterface $logger = null)
    {
        $this->objectPersister = $objectPersister;
        $this->objectClass     = $objectClass;
        $this->events          = $events;
        $this->logger          = $logger;
    }

    /**
     * @return array
     */
    public function getSubscribedEvents()
    {
        return $this->events;
    }

    /**
     * Log the failure message if a logger is available
     *
     * $param string $message
     */
    protected function logFailure($message)
    {
        if (null !== $this->logger) {
            $this->logger->warn(sprintf('%s: %s', get_class($this), $message));
        }
    }
}
{'fraction_non_alphanumeric': 0.11854899027673897, 'fraction_numerical': 0.0, 'mean_word_length': 2.096064814814815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2825565', 'n_tokens_mistral': 777, 'n_tokens_neox': 767, 'n_words': 172}