Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
PSDI Army
yii2
Commits
f7edebb2
Commit
f7edebb2
authored
Mar 26, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test break.
parent
f8b63591
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
Dispatcher.php
framework/log/Dispatcher.php
+12
-5
TargetTest.php
tests/unit/framework/log/TargetTest.php
+4
-1
No files found.
framework/log/Dispatcher.php
View file @
f7edebb2
...
...
@@ -60,6 +60,10 @@ class Dispatcher extends Component
* or the configuration for creating the log target instance.
*/
public
$targets
=
[];
/**
* @var Logger the logger. If not set, [[\Yii::getLogger()]] will be used.
*/
public
$logger
;
/**
* Initializes the logger by registering [[flush()]] as a shutdown function.
...
...
@@ -74,7 +78,10 @@ class Dispatcher extends Component
}
}
Yii
::
getLogger
()
->
dispatcher
=
$this
;
if
(
$this
->
logger
===
null
)
{
$this
->
logger
=
Yii
::
getLogger
();
}
$this
->
logger
->
dispatcher
=
$this
;
}
/**
...
...
@@ -83,7 +90,7 @@ class Dispatcher extends Component
*/
public
function
getTraceLevel
()
{
return
Yii
::
getLogger
()
->
traceLevel
;
return
$this
->
logger
->
traceLevel
;
}
/**
...
...
@@ -94,7 +101,7 @@ class Dispatcher extends Component
*/
public
function
setTraceLevel
(
$value
)
{
Yii
::
getLogger
()
->
traceLevel
=
$value
;
$this
->
logger
->
traceLevel
=
$value
;
}
/**
...
...
@@ -103,7 +110,7 @@ class Dispatcher extends Component
*/
public
function
getFlushInterval
()
{
return
Yii
::
getLogger
()
->
flushInterval
;
return
$this
->
logger
->
flushInterval
;
}
/**
...
...
@@ -116,7 +123,7 @@ class Dispatcher extends Component
*/
public
function
setFlushInterval
(
$value
)
{
Yii
::
getLogger
()
->
flushInterval
=
$value
;
$this
->
logger
->
flushInterval
=
$value
;
}
/**
...
...
tests/unit/framework/log/TargetTest.php
View file @
f7edebb2
...
...
@@ -5,6 +5,7 @@
namespace
yiiunit\framework\log
;
use
yii\log\Dispatcher
;
use
yii\log\Logger
;
use
yii\log\Target
;
use
yiiunit\TestCase
;
...
...
@@ -50,7 +51,9 @@ class TargetTest extends TestCase
{
static
::
$messages
=
[];
$logger
=
new
Logger
([
$logger
=
new
Logger
;
$dispatcher
=
new
Dispatcher
([
'logger'
=>
$logger
,
'targets'
=>
[
new
TestTarget
(
array_merge
(
$filter
,
[
'logVars'
=>
[]]))],
'flushInterval'
=>
1
,
]);
...
...
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