Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 633c039

Browse filesBrowse files
committed
[Workflow] Added the workflow name in log generated by AuditTrailListener
1 parent b786bcc commit 633c039
Copy full SHA for 633c039

File tree

Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed

‎src/Symfony/Component/Workflow/EventListener/AuditTrailListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/EventListener/AuditTrailListener.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ public function __construct(LoggerInterface $logger)
3030
public function onLeave(Event $event)
3131
{
3232
foreach ($event->getTransition()->getFroms() as $place) {
33-
$this->logger->info(sprintf('Leaving "%s" for subject of class "%s".', $place, get_class($event->getSubject())));
33+
$this->logger->info(sprintf('Leaving "%s" for subject of class "%s" in workflow "%s".', $place, get_class($event->getSubject()), $event->getWorkflowName()));
3434
}
3535
}
3636

3737
public function onTransition(Event $event)
3838
{
39-
$this->logger->info(sprintf('Transition "%s" for subject of class "%s".', $event->getTransition()->getName(), get_class($event->getSubject())));
39+
$this->logger->info(sprintf('Transition "%s" for subject of class "%s" in workflow "%s".', $event->getTransition()->getName(), get_class($event->getSubject()), $event->getWorkflowName()));
4040
}
4141

4242
public function onEnter(Event $event)
4343
{
4444
foreach ($event->getTransition()->getTos() as $place) {
45-
$this->logger->info(sprintf('Entering "%s" for subject of class "%s".', $place, get_class($event->getSubject())));
45+
$this->logger->info(sprintf('Entering "%s" for subject of class "%s" in workflow "%s".', $place, get_class($event->getSubject()), $event->getWorkflowName()));
4646
}
4747
}
4848

‎src/Symfony/Component/Workflow/Tests/EventListener/AuditTrailListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/Tests/EventListener/AuditTrailListenerTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public function testItWorks()
3333
$workflow->apply($object, 't1');
3434

3535
$expected = array(
36-
'Leaving "a" for subject of class "stdClass".',
37-
'Transition "t1" for subject of class "stdClass".',
38-
'Entering "b" for subject of class "stdClass".',
36+
'Leaving "a" for subject of class "stdClass" in workflow "unnamed".',
37+
'Transition "t1" for subject of class "stdClass" in workflow "unnamed".',
38+
'Entering "b" for subject of class "stdClass" in workflow "unnamed".',
3939
);
4040

4141
$this->assertSame($expected, $logger->logs);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.