Skip to content

Commit a90c853

Browse files
authored
MAGECLOUD-2919: Wrong Log Level for Starting/Finishing Deployment Phases (#382)
1 parent 90d6675 commit a90c853

17 files changed

+67
-40
lines changed

src/Command/Build/Generate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ protected function configure()
7171
public function execute(InputInterface $input, OutputInterface $output)
7272
{
7373
try {
74-
$this->logger->info('Starting generate command. ' . $this->packageManager->getPrettyInfo());
74+
$this->logger->notice('Starting generate command. ' . $this->packageManager->getPrettyInfo());
7575
$this->process->execute();
76-
$this->logger->info('Generate command completed.');
76+
$this->logger->notice('Generate command completed.');
7777
} catch (\Throwable $e) {
7878
$this->logger->critical($e->getMessage());
7979

src/Command/Build/Transfer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ protected function configure()
6161
public function execute(InputInterface $input, OutputInterface $output)
6262
{
6363
try {
64-
$this->logger->info('Starting transfer files.');
64+
$this->logger->notice('Starting transfer files.');
6565
$this->process->execute();
66-
$this->logger->info('Transfer completed.');
66+
$this->logger->notice('Transfer completed.');
6767
} catch (\Throwable $e) {
6868
$this->logger->critical($e->getMessage());
6969

src/Process/Build/ApplyPatches.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ public function __construct(
4343
*/
4444
public function execute()
4545
{
46-
$this->logger->info('Applying patches.');
46+
$this->logger->notice('Applying patches.');
4747

4848
try {
4949
$this->manager->applyAll();
5050
} catch (GenericException $exception) {
5151
throw new ProcessException($exception->getMessage(), $exception->getCode(), $exception);
5252
}
53+
$this->logger->notice('End of applying patches.');
5354
}
5455
}

src/Process/Build/BackupData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function __construct(LoggerInterface $logger, ProcessInterface $processes
4040
*/
4141
public function execute()
4242
{
43-
$this->logger->info('Copying data to the ./init directory');
43+
$this->logger->notice('Copying data to the ./init directory');
4444
$this->processes->execute();
45+
$this->logger->notice('End of copying data to the ./init directory');
4546
}
4647
}

src/Process/Build/DeployStaticContent.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public function execute()
6969
return;
7070
}
7171

72+
$this->logger->notice('Generating fresh static content');
7273
$this->process->execute();
7374
$this->flagManager->set(FlagManager::FLAG_STATIC_CONTENT_DEPLOY_IN_BUILD);
75+
$this->logger->notice('End of generating fresh static content');
7476
}
7577
}

src/Process/Deploy/DeployStaticContent.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public function execute()
9797
$this->staticContentCleaner->clean();
9898
}
9999

100-
$this->logger->info('Generating fresh static content');
100+
$this->logger->notice('Generating fresh static content');
101101
$this->process->execute();
102+
$this->logger->notice('End of generating fresh static content');
102103
}
103104
}

src/Process/Deploy/InstallUpdate.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ public function execute()
5959
{
6060
try {
6161
if (!$this->deployConfig->isInstalled()) {
62-
$this->logger->info('Starting install.');
62+
$this->logger->notice('Starting install.');
6363
$this->installProcess->execute();
64+
$this->logger->notice('End of install.');
6465
} else {
65-
$this->logger->info('Starting update.');
66+
$this->logger->notice('Starting update.');
6667
$this->updateProcess->execute();
68+
$this->logger->notice('End of update.');
6769
}
6870
} catch (GenericException $exception) {
6971
throw new ProcessException($exception->getMessage(), $exception->getCode(), $exception);

src/Process/Deploy/PreDeploy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ public function __construct(
5757
*/
5858
public function execute()
5959
{
60-
$this->logger->info('Starting pre-deploy.');
60+
$this->logger->notice('Starting pre-deploy.');
6161
$this->process->execute();
6262

6363
try {
6464
$this->maintenanceModeSwitcher->enable();
6565
} catch (ShellException $exception) {
6666
throw new ProcessException($exception->getMessage(), $exception->getCode(), $exception);
6767
}
68+
$this->logger->notice('End of pre-deploy.');
6869
}
6970
}

src/Process/Deploy/PreDeploy/RestoreWritableDirectories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function execute()
7878
}
7979

8080
// Restore mounted directories.
81-
$this->logger->info('Recoverable directories were copied back.');
81+
$this->logger->notice('Recoverable directories were copied back.');
8282
$this->flagManager->delete(FlagManager::FLAG_REGENERATE);
8383
}
8484
}

src/Test/Unit/Command/Build/GenerateTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function setUp()
5959
public function testExecute()
6060
{
6161
$this->loggerMock->expects($this->exactly(2))
62-
->method('info')
62+
->method('notice')
6363
->withConsecutive(
6464
['Starting generate command. Some info.'],
6565
['Generate command completed.']
@@ -88,7 +88,7 @@ public function testExecuteWithException()
8888
->method('getPrettyInfo')
8989
->willReturn('Some info.');
9090
$this->loggerMock->expects($this->once())
91-
->method('info')
91+
->method('notice')
9292
->with('Starting generate command. Some info.');
9393
$this->loggerMock->expects($this->once())
9494
->method('critical')

0 commit comments

Comments
 (0)