Skip to content

[5.6] Fix cache for loggers#23118

Merged
taylorotwell merged 3 commits into
laravel:5.6from
CyrilMazur:logging
Feb 11, 2018
Merged

[5.6] Fix cache for loggers#23118
taylorotwell merged 3 commits into
laravel:5.6from
CyrilMazur:logging

Conversation

@CyrilMazur

Copy link
Copy Markdown
Contributor

This fixes #23117

@laurencei

Copy link
Copy Markdown
Contributor

Could you add some tests to show it is getting the same instance? That will help prevent regressions later.

@CyrilMazur

Copy link
Copy Markdown
Contributor Author

@laurencei done

@CyrilMazur CyrilMazur changed the title Cache loggers [5.6] Cache loggers Feb 11, 2018
Comment thread tests/Log/LogManagerTest.php Outdated
$logger1 = $manager->channel('single')->getLogger();
$logger2 = $manager->channel('single')->getLogger();

$this->assertEquals(spl_object_id($logger1), spl_object_id($logger2));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be an $this->assertSame($logger1, $logger2);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just do assertSame on the objects.

Comment thread tests/Log/LogManagerTest.php Outdated
$logger1 = $manager->channel('single')->getLogger();
$logger2 = $manager->channel('single')->getLogger();

$this->assertEquals(spl_object_id($logger1), spl_object_id($logger2));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just do assertSame on the objects.

@GrahamCampbell GrahamCampbell changed the title [5.6] Cache loggers [5.7] Cache loggers Feb 11, 2018
@CyrilMazur

Copy link
Copy Markdown
Contributor Author

@GrahamCampbell done. I realise I opened this PR into the wrong branch. I intended this PR for 5.6 (it's a bug fix), should I open a new PR?

@CyrilMazur
CyrilMazur changed the base branch from master to 5.6 February 11, 2018 12:21
@CyrilMazur CyrilMazur changed the title [5.7] Cache loggers [5.6] Fix cache for loggers Feb 11, 2018
@GrahamCampbell

Copy link
Copy Markdown
Collaborator

Hard reset your branch to 5.6, then cherry-pick your commits and force push.

@CyrilMazur

Copy link
Copy Markdown
Contributor Author

Thanks. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants