PHP Class think\Log

Show file Open project: top-think/framework Class Usage Examples

Protected Properties

Property Type Description
$config 配置参数
$driver 日志写入驱动
$key 当前日志授权key
$log 日志信息
$type 日志类型

Public Methods

Method Description
__callStatic ( $method, $args ) : mixed 静态调用
check ( array $config ) : boolean 检查日志写入权限
clear ( ) : void 清空日志信息
getLog ( string $type = '' ) : array 获取日志信息
init ( array $config = [] ) 日志初始化
key ( string $key ) : void 当前日志记录的授权key
record ( mixed $msg, string $type = 'log' ) : void 记录调试信息
save ( ) : boolean 保存调试信息
write ( mixed $msg, string $type = 'log', boolean $force = false ) : boolean 实时写入日志信息 并支持行为

Method Details

__callStatic() public static method

静态调用
public static __callStatic ( $method, $args ) : mixed
$method
$args
return mixed

check() public static method

检查日志写入权限
public static check ( array $config ) : boolean
$config array 当前日志配置参数
return boolean

clear() public static method

清空日志信息
public static clear ( ) : void
return void

getLog() public static method

获取日志信息
public static getLog ( string $type = '' ) : array
$type string 信息类型
return array

init() public static method

日志初始化
public static init ( array $config = [] )
$config array

key() public static method

当前日志记录的授权key
public static key ( string $key ) : void
$key string 授权key
return void

record() public static method

记录调试信息
public static record ( mixed $msg, string $type = 'log' ) : void
$msg mixed 调试信息
$type string 信息类型
return void

save() public static method

保存调试信息
public static save ( ) : boolean
return boolean

write() public static method

实时写入日志信息 并支持行为
public static write ( mixed $msg, string $type = 'log', boolean $force = false ) : boolean
$msg mixed 调试信息
$type string 信息类型
$force boolean 是否强制写入
return boolean

Property Details

$config protected static property

配置参数
protected static $config

$driver protected static property

日志写入驱动
protected static $driver

$key protected static property

当前日志授权key
protected static $key

$log protected static property

日志信息
protected static $log

$type protected static property

日志类型
protected static $type