Basicis - Core

Logo

As the name says, it is made to be basic and direct.

View the Project on GitHub basicis/core

Basicis\Core\Log

Log Class Describes a logger instance.

The message MUST be a string or object implementing __toString().

The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key “foo”. The context array can contain arbitrary data, the only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named “exception”. See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md for the full interface specification.

Implements:

Psr\Log\LoggerInterface

Methods

Name Description
__construct Function __construct
alert Function alert
Action must be taken immediately.  
critical Function critical
Critical conditions.  
debug Funtion debug
Detailed debug information  
emergency Function emergency
System is unusable.  
error Function error
Runtime errors that do not require immediate action but should typically be logged and monitored.  
formatMessage Function formatMessage
Format Message to file log line  
formatMessageToArray Function formatMessageToArray
Format Message line, and return this as array  
getByDate Function getByDate
Get a log file by string date and return a array with contents  
info Function info
Interesting events.  
interpolate Function interpolate
Interpolates context values into the message placeholders.  
log Function log
Logs with an arbitrary level.  
notice Function notice
Normal but significant events  
warning Function warning
Exceptional occurrences that are not errors.  

Log::__construct

Description

public __construct (string $path, string $email)

Function __construct

Parameters

Return Values

void


Log::alert

Description

public alert (string $message, array $context)

Function alert Action must be taken immediately.

Parameters

Return Values

void


Log::critical

Description

public critical (string $message, array $context)

Function critical Critical conditions.

Parameters

Return Values

void


Log::debug

Description

public debug (string $message, array $context)

Funtion debug Detailed debug information

Parameters

Return Values

void


Log::emergency

Description

public emergency (string $message, array $context)

Function emergency System is unusable.

Parameters

Return Values

void


Log::error

Description

public error (string $message, array $context)

Function error Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters

Return Values

void


Log::formatMessage

Description

public formatMessage (string $level, string $message, string $date_format, string $format)

Function formatMessage Format Message to file log line

Parameters

Return Values

string


Log::formatMessageToArray

Description

public formatMessageToArray (string $level, string $message, string $date_format)

Function formatMessageToArray Format Message line, and return this as array

[  
  "date" => Y/m/d H:i:s,  
  "level" => "Level",  
  "message" => "Text Message interpolated.",  
  "context" => array()  
];  

Parameters

Return Values

string


Log::getByDate

Description

public getByDate (string $date)

Function getByDate Get a log file by string date and return a array with contents

Parameters

Return Values

array|null


Log::info

Description

public info (string $message, array $context)

Function info Interesting events.

Parameters

Return Values

void


Log::interpolate

Description

public interpolate (string $message, array $context)

Function interpolate Interpolates context values into the message placeholders.

Parameters

Return Values

string


Log::log

Description

public log (mixed $level, string $message, array $context)

Function log Logs with an arbitrary level.

Parameters

Return Values

void


Log::notice

Description

public notice (string $message, array $context)

Function notice Normal but significant events

Parameters

Return Values

void


Log::warning

Description

public warning (string $message, array $context)

Function warning Exceptional occurrences that are not errors.

Parameters

Return Values

void