91 lines
3.3 KiB
PHP
91 lines
3.3 KiB
PHP
<?php
|
|
namespace nulib\output\std;
|
|
|
|
use nulib\output\IMessenger;
|
|
|
|
/**
|
|
* Interface _IMessenger: méthodes privées de IMessenger
|
|
*/
|
|
interface _IMessenger extends IMessenger {
|
|
const INDENT = " ";
|
|
|
|
const DATE_FORMAT = 'Y-m-d\TH:i:s.u';
|
|
|
|
const VALID_LEVELS = [self::DEBUG, self::MINOR, self::NORMAL, self::MAJOR, self::NONE];
|
|
|
|
const LEVEL_MAP = [
|
|
"debug" => self::DEBUG,
|
|
"minor" => self::MINOR, "verbose" => self::MINOR,
|
|
"normal" => self::NORMAL,
|
|
"major" => self::MAJOR, "quiet" => self::MAJOR,
|
|
"none" => self::NONE, "silent" => self::NONE,
|
|
];
|
|
|
|
const GENERIC_PREFIXES = [
|
|
self::MAJOR => [
|
|
"section" => [true, "SECTION!", "===", "<color @b>=", "=</color>", "==="],
|
|
"title" => [false, "TITLE!", null, "<color @b>T", "</color>", "==="],
|
|
"desc" => ["DESC!", "<color @b>></color>", ""],
|
|
"error" => ["CRIT.ERROR!", "<color @r>E!", "</color>"],
|
|
"warning" => ["CRIT.WARNING!", "<color @y>W!", "</color>"],
|
|
"note" => ["ATTENTION!", "<color @g>N!", "</color>"],
|
|
"info" => ["IMPORTANT!", "<color @b>N!", "</color>"],
|
|
"step" => ["*", "<color @w>.</color>", ""],
|
|
"print" => [null, null, null],
|
|
],
|
|
self::NORMAL => [
|
|
"section" => [true, "SECTION:", "---", "<color @b>-", "-</color>", "---"],
|
|
"title" => [false, "TITLE:", null, "<color @b>T</color><color b>", "</color>", "---"],
|
|
"desc" => ["DESC:", "<color @b>></color>", ""],
|
|
"error" => ["ERROR:", "<color @r>E</color><color r>", "</color>"],
|
|
"warning" => ["WARNING:", "<color @y>W</color><color y>", "</color>"],
|
|
"note" => ["NOTE:", "<color @g>N</color>", ""],
|
|
"info" => ["INFO:", "<color @b>I</color>", ""],
|
|
"step" => ["*", "<color @w>.</color>", ""],
|
|
"print" => [null, null, null],
|
|
],
|
|
self::MINOR => [
|
|
"section" => [true, "section", null, "<color @w>>>", "<<</color>", null],
|
|
"title" => [false, "title", null, "<color b>t", "</color>", null],
|
|
"desc" => ["desc", "<color b>></color>", ""],
|
|
"error" => ["error", "<color r>E</color><color -r>", "</color>"],
|
|
"warning" => ["warning", "<color y>W</color><color -y>", "</color>"],
|
|
"note" => ["note", "<color g>N</color>", ""],
|
|
"info" => ["info", "<color b>I</color><color w>", "</color>"],
|
|
"step" => ["*", "<color w>.</color>", ""],
|
|
"print" => [null, null, null],
|
|
],
|
|
self::DEBUG => [
|
|
"section" => [true, "section", null, "<color @w>>>", "<<</color>", null],
|
|
"title" => [false, "title", null, "<color b>t", "</color>", null],
|
|
"desc" => ["desc", "<color b>></color>", ""],
|
|
"error" => ["debugE", "<color r>e</color><color -r>", "</color>"],
|
|
"warning" => ["debugW", "<color y>w</color><color -y>", "</color>"],
|
|
"note" => ["debugN", "<color b>i</color>", ""],
|
|
"info" => ["debug", "<color @w>D</color><color w>", "</color>"],
|
|
"step" => ["*", "<color w>.</color>", ""],
|
|
"print" => [null, null, null],
|
|
],
|
|
];
|
|
|
|
const RESULT_PREFIXES = [
|
|
"failure" => ["(FAILURE)", "<color r>✘</color>"],
|
|
"success" => ["(SUCCESS)", "<color @g>✔</color>"],
|
|
"done" => [null, null],
|
|
];
|
|
|
|
function _endSection(): void;
|
|
|
|
function _getTitleMark(): int;
|
|
|
|
function _getTitleId(): ?int;
|
|
|
|
function _endTitle(?int $until=null): void;
|
|
|
|
function _getActionMark(): int;
|
|
|
|
function _getActionId(): ?int;
|
|
|
|
function _endAction(?int $until=null): void;
|
|
}
|