Log

Description

Static logger.

Public Static Properties

static $verbose = false
 

Protected Static Properties

static array $colors
 ANSI escape colors. More...
 

Public Static Methods

static void debug (string $text)
 Outputs a debug line to STDERR More...
 
static void disableColors ()
 
static void entity (string $entity)
 Outputs an entity name to STDERR More...
 
static void error (string $error)
 Outputs an error to STDERR More...
 
static void line (string $text='')
 Outputs a raw line to STDERR without decoration. More...
 
static void member (string $code, $member, int $level=LOG_INFO)
 Outputs a line about entity member/s to STDERR More...
 
static mixed var ($mixed)
 Exports a variable to STDERR and returns it back for fluency. More...
 
static mixed verbose ($text='', int $level=-1)
 Outputs an indented verbose line to STDERR More...
 
static void verboseMember (string $code, $member, int $level=-1)
 { More...
 

Properties

◆ $colors

array $colors
staticprotected
Initial value:
= [
0 => "\e[0m",
'entity' => "\e[97m",
LOG_DEBUG => "\e[90m",
LOG_ERR => "\e[91m",
LOG_USER => "\e[92m",
LOG_WARNING => "\e[93m",
LOG_INFO => "\e[94m",
~LOG_DEBUG => "\e[30m",
-1 => "\e[30m",
~LOG_ERR => "\e[31m",
~LOG_USER => "\e[32m",
~LOG_WARNING => "\e[33m",
~LOG_INFO => "\e[34m",
]

ANSI escape colors.

Methods

◆ debug()

static void debug ( string  $text)
static

Outputs a debug line to STDERR

Parameters
string$text

◆ entity()

static void entity ( string  $entity)
static

Outputs an entity name to STDERR

Parameters
string$entity

◆ error()

static void error ( string  $error)
static

Outputs an error to STDERR

Parameters
string$error

◆ line()

static void line ( string  $text = '')
static

Outputs a raw line to STDERR without decoration.

Parameters
string$text

◆ member()

static void member ( string  $code,
  $member,
int  $level = LOG_INFO 
)
static

Outputs a line about entity member/s to STDERR

Color will apply to the whole line if $level is negative / more severe than LOG_INFO.

Parameters
string$code
string | string[]$member
int$level

◆ var()

static mixed var (   $mixed)
static

Exports a variable to STDERR and returns it back for fluency.

Parameters
mixed$mixed
Returns
mixed

◆ verbose()

static mixed verbose (   $text = '',
int  $level = -1 
)
static

Outputs an indented verbose line to STDERR

Always ensure XMLWriterInterface::write() only has one possible trailing line when applicable.

Parameters
string | string[]$textLine/s
int$level
Returns
mixed The lines given.

◆ verboseMember()

static void verboseMember ( string  $code,
  $member,
int  $level = -1 
)
static

{

See also
member()} with an added check on the verbosity flag.
Parameters
string$code
string | string[]$member
int$level