rosavox/lib/alveolata/log/output-implementation-restricted.php

66 lines
1.2 KiB
PHP
Raw Normal View History

2025-05-23 07:33:29 +00:00
<?php
namespace alveolata\log;
// require_once(DIR_ALVEOLATA . '/definitions.php');
require_once(DIR_ALVEOLATA . '/string/functions.php');
require_once(DIR_ALVEOLATA . '/json/functions.php');
require_once(DIR_ALVEOLATA . '/report/functions.php');
require_once(DIR_ALVEOLATA . '/log/output-interface.php');
/**
* @author Christian Fraß <frass@greenscale.de>
*/
class implementation_restricted implements interface_output
{
/**
* @var interface_output
* @author Christian Fraß <frass@greenscale.de>
*/
protected $core;
/**
* @var int
* @author Christian Fraß <frass@greenscale.de>
*/
protected $level_threshold;
/**
* @param int $level_threshold
* @author Christian Fraß <frass@greenscale.de>
*/
public function __construct(
interface_output $core,
int $level_threshold
)
{
$this->core = $core;
$this->level_threshold = $level_threshold;
}
/**
* @implementation
* @author Christian Fraß <frass@greenscale.de>
*/
public function process(
int $level,
\alveolata\report\struct_report $report
) : void
{
if ($level <= $this->level_threshold) {
$this->core->process($level, $report);
}
else {
// do nothing
}
}
}
?>