Skip to content

Commit f2185fd

Browse files
authored
Merge pull request #30 from mirko-bukilic/master
Log content that is printed to console during task execution
2 parents 616f7b1 + 6bdf7a8 commit f2185fd

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"ext-pdo" : "*",
3131
"php" : ">=5.6",
3232
"g4/cron" : "*",
33-
"g4/log" : "1.13.*"
33+
"g4/log" : "1.14.*"
3434
},
3535
"require-dev": {
3636
"phpunit/phpunit" : "5.*",

src/Tasker2/Runner.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ public function execute()
9898

9999
$this->taskDomain->setStartedCount($this->taskDomain->getStartedCount() + 1);
100100

101+
ob_start();
101102
$task->execute();
103+
$this->taskerExecution->setOutput(ob_get_flush());
102104
$this->logNewRelicEnd();
103105
} catch (\Exception $e) {
106+
$this->taskerExecution->setOutput(ob_get_flush());
104107
$this->handleException($e);
105108
throw $e;
106109
}

0 commit comments

Comments
 (0)