-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugBundle.php
More file actions
101 lines (82 loc) · 2.65 KB
/
Copy pathDebugBundle.php
File metadata and controls
101 lines (82 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
declare(strict_types=1);
namespace DebugBundle;
final class DebugBundle
{
private static ?DebugBundleSdk $sdk = null;
/** @param array<string, mixed> $config */
public static function init(array $config): void
{
self::sdk()->init($config);
}
/** @param array<string, mixed>|null $context */
public static function captureException(\Throwable $error, ?array $context = null): void
{
self::sdk()->captureException($error, $context);
}
/** @param array<string, mixed>|null $context */
public static function captureError(\Throwable $error, ?array $context = null): void
{
self::sdk()->captureError($error, $context);
}
/** @param array<string, mixed>|null $context */
public static function captureLog(string $message, string $level = 'warning', ?array $context = null): void
{
self::sdk()->captureLog($message, $level, $context);
}
/**
* @param array<string, mixed> $request
* @param array<string, mixed>|null $response
* @param array<string, mixed>|null $context
*/
public static function captureRequest(array $request, ?array $response = null, ?array $context = null): void
{
self::sdk()->captureRequest($request, $response, $context);
}
/** @param array<string, mixed>|null $context */
public static function captureMessage(string $message, ?string $level = null, ?array $context = null): void
{
self::sdk()->captureMessage($message, $level, $context);
}
public static function setContext(string $key, mixed $value): void
{
self::sdk()->setContext($key, $value);
}
public static function flush(): void
{
self::sdk()->flush();
}
/** @return 'healthy'|'degraded'|'disconnected' */
public static function getStatus(): string
{
return self::sdk()->getStatus();
}
public static function getLastEventAt(): ?float
{
return self::sdk()->getLastEventAt();
}
/** @param array<string, mixed>|null $opts */
public static function probe(string $label, mixed $data, ?array $opts = null): void
{
self::sdk()->probe($label, $data, $opts);
}
public static function captureErrors(): void
{
self::sdk()->captureErrors();
}
public static function captureExceptions(): void
{
self::sdk()->captureExceptions();
}
public static function captureShutdown(): void
{
self::sdk()->captureShutdown();
}
private static function sdk(): DebugBundleSdk
{
if (self::$sdk === null) {
self::$sdk = new DebugBundleSdk();
}
return self::$sdk;
}
}