2014-02-26 04:47:02 -05:00
|
|
|
<?php
|
2026-03-26 12:46:27 -04:00
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2014-02-26 04:47:02 -05:00
|
|
|
|
2014-10-31 05:27:17 -04:00
|
|
|
namespace Icinga\Application\Logger;
|
2014-02-26 04:47:02 -05:00
|
|
|
|
2014-11-18 07:11:52 -05:00
|
|
|
use Icinga\Data\ConfigObject;
|
2014-02-26 04:47:02 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Abstract class for writers that write messages to a log
|
|
|
|
|
*/
|
|
|
|
|
abstract class LogWriter
|
|
|
|
|
{
|
2014-11-11 13:39:15 -05:00
|
|
|
/**
|
2014-11-18 07:11:52 -05:00
|
|
|
* @var ConfigObject
|
2014-11-11 13:39:15 -05:00
|
|
|
*/
|
|
|
|
|
protected $config;
|
|
|
|
|
|
2014-02-26 04:47:02 -05:00
|
|
|
/**
|
|
|
|
|
* Create a new log writer initialized with the given configuration
|
|
|
|
|
*/
|
2014-11-18 07:11:52 -05:00
|
|
|
public function __construct(ConfigObject $config)
|
2014-11-11 13:39:15 -05:00
|
|
|
{
|
|
|
|
|
$this->config = $config;
|
|
|
|
|
}
|
2014-02-26 04:47:02 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Log a message with the given severity
|
|
|
|
|
*/
|
|
|
|
|
abstract public function log($severity, $message);
|
|
|
|
|
}
|