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
093f5ebd
Commit
093f5ebd
authored
Mar 27, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure log dispatcher gets registered with logger in all cases
fixes #2894
parent
09411463
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
Dispatcher.php
framework/log/Dispatcher.php
+3
-3
LoggerTest.php
tests/unit/framework/log/LoggerTest.php
+3
-0
TargetTest.php
tests/unit/framework/log/TargetTest.php
+3
-0
No files found.
framework/log/Dispatcher.php
View file @
093f5ebd
...
...
@@ -78,7 +78,7 @@ class Dispatcher extends Component
public
function
__construct
(
$config
=
[])
{
if
(
isset
(
$config
[
'logger'
]))
{
$this
->
_logger
=
$config
[
'logger'
]
;
$this
->
setLogger
(
$config
[
'logger'
])
;
unset
(
$config
[
'logger'
]);
}
// connect logger and dispatcher
...
...
@@ -110,8 +110,7 @@ class Dispatcher extends Component
public
function
getLogger
()
{
if
(
$this
->
_logger
===
null
)
{
$this
->
_logger
=
Yii
::
getLogger
();
$this
->
_logger
->
dispatcher
=
$this
;
$this
->
setLogger
(
Yii
::
getLogger
());
}
return
$this
->
_logger
;
}
...
...
@@ -123,6 +122,7 @@ class Dispatcher extends Component
public
function
setLogger
(
$value
)
{
$this
->
_logger
=
$value
;
$this
->
_logger
->
dispatcher
=
$this
;
}
/**
...
...
tests/unit/framework/log/LoggerTest.php
View file @
093f5ebd
...
...
@@ -8,6 +8,9 @@ namespace yiiunit\framework\log;
use
yii\log\Logger
;
use
yiiunit\TestCase
;
/**
* @group log
*/
class
LoggerTest
extends
TestCase
{
...
...
tests/unit/framework/log/TargetTest.php
View file @
093f5ebd
...
...
@@ -10,6 +10,9 @@ use yii\log\Logger;
use
yii\log\Target
;
use
yiiunit\TestCase
;
/**
* @group log
*/
class
TargetTest
extends
TestCase
{
public
static
$messages
;
...
...
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