forked from aizuyan/phplog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestlog.php
More file actions
33 lines (30 loc) · 877 Bytes
/
testlog.php
File metadata and controls
33 lines (30 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
class Testlog{
/**
* @var object $log 保存Log对象实例
*/
public static $log;
/**
* @desc 测是开始
*/
public static function go(){
/**
* @desc 包含日志容器和日志写入类库
*/
include_once("./log.php");
/**
* @desc 包含異常處理類文件
*/
require_once("./myexception.php");
self::$log = Log::instance();
self::$log->attach(new Logwriter("./data/debug"),Log::DEBUG);
self::$log->attach(new Logwriter("./data/notice"),Log::NOTICE);
set_exception_handler(array("Myexception","exceptionHandler"));
set_error_handler(array("Myexception","errorHandler"));
//设置一个程序异常终止的时候的错误处理函数
register_shutdown_function(array("Myexception","shutdownHandler"));
}
}
Testlog::go();
Testlog::$log->add(Log::STRACE,'jjjjyrtj',array('file'=>__FILE__,'line'=>__LINE__));
echo $b;