File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change 1
- <?php
2
- class FileLog {
3
- public static function logThrowable (Throwable $ e , string $ dir , string $ title = '' ) {
4
- if (! is_dir ($ dir ))
5
- mkdir ($ dir );
6
- $ s = sprintf ('[%s] %s: ' , date ('Y-m-d H:i:s ' , time ()), $ title );
7
- $ s .= str_replace ([
8
- BASEDIR ,
9
- "\n"
10
- ], [
11
- '' ,
12
- '<== '
13
- ], $ e ->getFile () . "( {$ e ->getLine ()})) \n{$ e ->getTraceAsString ()}" ) . "\n" ;
14
- $ fp = fopen ($ dir . date ('Y-m-d ' ) . '.log ' , 'a ' );
15
- fwrite ($ fp , $ s );
16
- fclose ($ fp );
17
- }
1
+ <?php
2
+ class FileLog {
3
+ public static function logThrowable (Throwable $ e , string $ dir , string $ title = '' ) {
4
+ if (! is_dir ($ dir ))
5
+ mkdir ($ dir );
6
+ $ s = sprintf ('[%s] %s: ' , date ('Y-m-d H:i:s ' , time ()), $ title );
7
+ $ s .= str_replace ([
8
+ BASEDIR ,
9
+ "\n"
10
+ ], [
11
+ '' ,
12
+ '<== '
13
+ ], $ e ->getMessage () . ' ' . $ e -> getFile () . "( {$ e ->getLine ()})) \n{$ e ->getTraceAsString ()}" ) . "\n" ;
14
+ $ fp = fopen ($ dir . date ('Y-m-d ' ) . '.log ' , 'a ' );
15
+ fwrite ($ fp , $ s );
16
+ fclose ($ fp );
17
+ }
18
18
}
You can’t perform that action at this time.
0 commit comments