@@ -18,11 +18,18 @@ class LogRecord
18
18
protected $ body = null ;
19
19
protected array $ attributes = [];
20
20
21
+ /**
22
+ * @param mixed $body
23
+ */
21
24
public function __construct ($ body = null )
22
25
{
23
26
$ this ->body = $ body ;
24
27
}
25
28
29
+ /**
30
+ * @param int $timestamp Timestamp, in nanoseconds since the unix epoch, when the event occurred.
31
+ * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-timestamp
32
+ */
26
33
public function setTimestamp (int $ timestamp ): self
27
34
{
28
35
$ this ->timestamp = $ timestamp ;
@@ -37,20 +44,32 @@ public function setContext(?ContextInterface $context = null): self
37
44
return $ this ;
38
45
}
39
46
47
+ /**
48
+ * @param int $severityNumber Severity number
49
+ * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-severitynumber
50
+ */
40
51
public function setSeverityNumber (int $ severityNumber ): self
41
52
{
42
53
$ this ->severityNumber = $ severityNumber ;
43
54
44
55
return $ this ;
45
56
}
46
57
58
+ /**
59
+ * @param string $severityText Severity text, also known as log level
60
+ * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-severitynumber
61
+ */
47
62
public function setSeverityText (string $ severityText ): self
48
63
{
49
64
$ this ->severityText = $ severityText ;
50
65
51
66
return $ this ;
52
67
}
53
68
69
+ /**
70
+ * @param iterable $attributes Additional information about the specific event occurrence.
71
+ * @see https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-attributes
72
+ */
54
73
public function setAttributes (iterable $ attributes ): self
55
74
{
56
75
foreach ($ attributes as $ name => $ value ) {
@@ -67,13 +86,19 @@ public function setAttribute(string $name, $value): self
67
86
return $ this ;
68
87
}
69
88
89
+ /**
90
+ * @param mixed $body The log record body
91
+ */
70
92
public function setBody ($ body = null ): self
71
93
{
72
94
$ this ->body = $ body ;
73
95
74
96
return $ this ;
75
97
}
76
98
99
+ /**
100
+ * @param int|null $observedTimestamp Time, in nanoseconds since the unix epoch, when the event was observed by the collection system.
101
+ */
77
102
public function setObservedTimestamp (int $ observedTimestamp = null ): self
78
103
{
79
104
$ this ->observedTimestamp = $ observedTimestamp ;
0 commit comments