ToConsole
extends ToMemory
in package
implements
Loggingable
Description of ToConsole.
Tags
Interfaces, Classes, Traits and Enums
Table of Contents
- $capacity : int
- Number of messages to keep.
- $debug : bool
- Debug mode flag.
- $logPrefix : string
- Adresář do kterého se zapisují logy.
- $logStyles : array<string|int, mixed>
- Hodnoty pro obarvování logu.
- $logType : string
- Předvolená metoda logování.
- $parentObject : Sand
- Odkaz na vlastnící objekt.
- $statusMessages : array<string|int, mixed>
- Messages live here.
- $stderr : resource
- Standard error handle.
- $stdout : false|resource
- Standard Output handle.
- $ansiCodes : array<string|int, mixed>
- Ansi Codes.
- $instance : mixed
- Saves obejct instace (singleton...).
- $messageID : int
- ID naposledy ulozene zpravy.
- __construct() : mixed
- Log Status messages to console.
- __toString() : string
- Magical function for all descendants (childern).
- addToLog() : int
- Zapise zapravu do logu.
- draw() : string
- Default draw method.
- getLogStyle() : string
- Vrací styl logování.
- getObjectName() : string
- Returns object name.
- getTypeColor() : string
- Get color code for given message.
- set() : string
- Set Ansi Color.
- singleton() : self
- Pri vytvareni objektu pomoci funkce singleton (ma stejne parametry, jako konstruktor) se bude v ramci behu programu pouzivat pouze jedna jeho instance (ta prvni).
Properties
$capacity
Number of messages to keep.
public
int
$capacity
= 1024
$debug
Debug mode flag.
public
bool
$debug
= false
$logPrefix
Adresář do kterého se zapisují logy.
public
string
$logPrefix
= ''
dirpath
$logStyles
Hodnoty pro obarvování logu.
public
array<string|int, mixed>
$logStyles
= ['notice' => 'color: black;', 'success' => 'color: #2C5F23;', 'message' => 'color: #2C5F23;', 'warning' => 'color: #AB250E;', 'error' => 'color: red;', 'debug' => 'font-style: italic;', 'report' => 'font-wight: bold;', 'info' => 'color: blue;']
$logType
Předvolená metoda logování.
public
string
$logType
= 'memory'
$parentObject
Odkaz na vlastnící objekt.
public
Sand
$parentObject
$statusMessages
Messages live here.
public
static array<string|int, mixed>
$statusMessages
= []
$stderr
Standard error handle.
public
resource
$stderr
$stdout
Standard Output handle.
public
false|resource
$stdout
$ansiCodes
Ansi Codes.
protected
static array<string|int, mixed>
$ansiCodes
= ['off' => 0, 'bold' => 1, 'italic' => 3, 'underline' => 4, 'blink' => 5, 'inverse' => 7, 'hidden' => 8, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37, 'black_bg' => 40, 'red_bg' => 41, 'green_bg' => 42, 'yellow_bg' => 43, 'blue_bg' => 44, 'magenta_bg' => 45, 'cyan_bg' => 46, 'white_bg' => 47]
$instance
Saves obejct instace (singleton...).
private
static mixed
$instance
$messageID
ID naposledy ulozene zpravy.
private
int
$messageID
= 0
unsigned
Methods
__construct()
Log Status messages to console.
public
__construct() : mixed
Return values
mixed —__toString()
Magical function for all descendants (childern).
public
__toString() : string
Return values
string —addToLog()
Zapise zapravu do logu.
public
addToLog(object|string $caller, string $message[, string $type = 'message' ]) : int
Parameters
- $caller : object|string
-
název volajícího objektu
- $message : string
-
zpráva
- $type : string = 'message'
-
typ zprávy (success|info|error|warning|*)
Return values
int —written message length
draw()
Default draw method.
public
draw() : string
Return values
string —getLogStyle()
Vrací styl logování.
public
getLogStyle([string $logType = 'notice' ]) : string
Parameters
- $logType : string = 'notice'
-
typ logu warning|info|success|error|notice|*
Return values
string —getObjectName()
Returns object name.
public
getObjectName() : string
Return values
string —getTypeColor()
Get color code for given message.
public
static getTypeColor(string $type) : string
Parameters
- $type : string
-
mail|warning|error|debug|success|info
Return values
string —set()
Set Ansi Color.
public
static set(string $str, string $color) : string
Parameters
- $str : string
-
string to colorize
- $color : string
-
color name
Return values
string —singleton()
Pri vytvareni objektu pomoci funkce singleton (ma stejne parametry, jako konstruktor) se bude v ramci behu programu pouzivat pouze jedna jeho instance (ta prvni).
public
static singleton() : self