Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#839 fix fatal error update monolog #841

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 14 additions & 2 deletions classes/local/execution/logging/mtrace_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
namespace tool_dataflows\local\execution\logging;

use Monolog\Handler\AbstractHandler;
use Monolog\Handler\AbstractProcessingHandler;

/**
* An environment for logging information about dataflow execution.
Expand All @@ -26,17 +27,28 @@
* @copyright Catalyst IT, 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class mtrace_handler extends AbstractHandler {
class mtrace_handler extends AbstractProcessingHandler {

/**
* Default handler for Moodle.
*
* @param array $record the log record
**/
public function handle(array $record) {
public function handle(array $record): bool {
if ($this->isHandling($record)) {
$record['formatted'] = trim($this->getFormatter()->format($record));
mtrace($record['formatted']);
return true;
}
return $this->handler->handle($record);
}

/**
* Writes the record down to the log of the implementing handler
* @param array $record
* @return void
*/
protected function write(array $record): void {
//mtrace($record);
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"config": {
"platform": {
"php": "7.1"
}
},
"vendor-dir": "dataflowvendor"
},
"require": {
"php": ">=7.1",
Expand Down
Loading
Loading