aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Support
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-09-03 08:37:50 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-09-05 20:58:39 +0200
commitff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa (patch)
treee2eaffa273423b047d9e4e66c12ae83244371d7f /lib/private/Support
parent0899f2cbc43b05005dc045db001c41e199192f67 (diff)
downloadnextcloud-server-ff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa.tar.gz
nextcloud-server-ff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa.zip
Add breadcrumb support to crash reporters
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Support')
-rw-r--r--lib/private/Support/CrashReport/Registry.php18
1 files changed, 18 insertions, 0 deletions
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;
@@ -42,6 +43,23 @@ class Registry implements IRegistry {
}
/**
+ * 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
*
* @param Exception|Throwable $exception