PHP Class Cml\Log

Show file Open project: linhecheng/cmlphp Class Usage Examples

Public Methods

Method Description
catcherPhpError ( integer $errorType, string $errorTip, string $errorFile, integer $errorLine ) : void 错误日志handler
critical ( string $log, array $context = [] ) : boolean 添加critical类型的日志
debug ( string $log, array $context = [] ) : boolean 添加debug类型的日志
emergency ( string $log, array $context = [] ) : boolean 添加critical类型的日志
error ( string $log, array $context = [] ) : boolean 添加error类型的日志
info ( string $log, array $context = [] ) : boolean 添加info类型的日志
notice ( string $log, array $context = [] ) : boolean 添加notice类型的日志
warning ( string $log, array $context = [] ) : boolean 添加warning类型的日志

Private Methods

Method Description
getLogger ( ) : Base 获取Logger实例

Method Details

catcherPhpError() public static method

错误日志handler
public static catcherPhpError ( integer $errorType, string $errorTip, string $errorFile, integer $errorLine ) : void
$errorType integer 错误类型 分运行时警告、运行时提醒、自定义错误、自定义提醒、未知等
$errorTip string 错误提示
$errorFile string 发生错误的文件
$errorLine integer 错误所在行数
return void

critical() public static method

添加critical类型的日志
public static critical ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean

debug() public static method

添加debug类型的日志
public static debug ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean

emergency() public static method

添加critical类型的日志
public static emergency ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean

error() public static method

添加error类型的日志
public static error ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean

info() public static method

添加info类型的日志
public static info ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean

notice() public static method

添加notice类型的日志
public static notice ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean

warning() public static method

添加warning类型的日志
public static warning ( string $log, array $context = [] ) : boolean
$log string 要记录到log的信息
$context array 上下文信息
return boolean