Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-rpc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-rpc
Commits
a33b9e4e
Commit
a33b9e4e
authored
Jun 02, 2020
by
fuyunnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改增加文件名称
parent
e0ce58c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
functions.php
src/functions.php
+5
-4
No files found.
src/functions.php
View file @
a33b9e4e
...
...
@@ -420,22 +420,23 @@ if (!function_exists('get_week_start_and_end')) {
if
(
!
function_exists
(
'putLog'
))
{
/**
* description:记录日志 文件会生成在当前项目 /runtime/dev/
当前日期名称
* description:记录日志 文件会生成在当前项目 /runtime/dev/
* author: fuyunnan
* @param string|array $output 日志内容
* @param string $dir 目录
* @param string $filename 文件名称
* date: 2020/3/18
* @throws
* @return void
*/
function
putLog
(
$output
=
'out-mes'
,
$dir
=
BASE_PATH
.
'/runtime/dev/'
)
function
putLog
(
$output
=
'out-mes'
,
$filename
=
''
,
$dir
=
BASE_PATH
.
'/runtime/dev/'
)
{
!
is_dir
(
$dir
)
&&
!
mkdir
(
$dir
,
0777
,
true
);
// 创建一个 Channel,参数 log 即为 Channel 的名字
$log
=
new
Logger
(
''
);
// 创建两个 Handler,对应变量 $stream 和 $fire
$filename
=
$dir
.
date
(
'Y-m-d'
,
time
())
.
'.log'
;
$stream
=
new
StreamHandler
(
$filename
,
Logger
::
WARNING
);
!
$filename
&&
$filename
=
date
(
'Y-m-d'
,
time
())
.
'.log'
;
$stream
=
new
StreamHandler
(
$
dir
.
$
filename
,
Logger
::
WARNING
);
$fire
=
new
FirePHPHandler
();
if
(
is_array
(
$output
))
{
$output
=
var_export
(
$output
,
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment