From ff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 3 Sep 2018 08:37:50 +0200 Subject: Add breadcrumb support to crash reporters Signed-off-by: Christoph Wurst --- lib/private/Support/CrashReport/Registry.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/private/Support') diff --git a/lib/private/Support/CrashReport/Registry.php b/lib/private/Support/CrashReport/Registry.php index 5eb78965c19..d07509561c6 100644 --- a/lib/private/Support/CrashReport/Registry.php +++ b/lib/private/Support/CrashReport/Registry.php @@ -23,6 +23,7 @@ namespace OC\Support\CrashReport; use Exception; +use OCP\Support\CrashReport\ICollectBreadcrumbs; use OCP\Support\CrashReport\IRegistry; use OCP\Support\CrashReport\IReporter; use Throwable; @@ -41,6 +42,23 @@ class Registry implements IRegistry { $this->reporters[] = $reporter; } + /** + * Delegate breadcrumb collection to all registered reporters + * + * @param string $message + * @param string $category + * @param array $context + * + * @since 13.0.0 + */ + public function delegateBreadcrumb(string $message, string $category, array $context = []) { + foreach ($this->reporters as $reporter) { + if ($reporter instanceof ICollectBreadcrumbs) { + $reporter->collect($message, $category, $context); + } + } + } + /** * Delegate crash reporting to all registered reporters * -- cgit v1.2.3