*/ class implementation_libnotify implements interface_output { /** * @param int $level_threshold * @author Christian Fraß */ public function __construct( ) { } /** * @implementation * @author Christian Fraß */ public function process( int $level, \alveolata\report\struct_report $report ) : void { $command = \alveolata\string\coin( 'notify-send \'[{{level}}] {{incident}}\' \'{{details}}\'', [ 'level' => output_translate_level($level), 'incident' => $report->incident, 'details' => implode( "\n", array_map( function ($key) use (&$report) { $value = $report->details[$key]; return \alveolata\string\coin( '{{key}}: {{value}}', [ 'key' => $key, 'value' => json_encode($value), ] ); }, array_keys($report->details) ) ), ] ); exec($command); } }