-
-
Notifications
You must be signed in to change notification settings - Fork 470
Expand file tree
/
Copy pathLog.php
More file actions
116 lines (91 loc) · 1.89 KB
/
Copy pathLog.php
File metadata and controls
116 lines (91 loc) · 1.89 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
declare(strict_types=1);
namespace Sentry\Logs;
use Sentry\Attributes\AttributeBag;
class Log
{
/**
* @var float
*/
private $timestamp;
/**
* @var string
*/
private $traceId;
/**
* @var LogLevel
*/
private $level;
/**
* @var string
*/
private $body;
/**
* @var AttributeBag
*/
private $attributes;
public function __construct(
float $timestamp,
string $traceId,
LogLevel $level,
string $body
) {
$this->timestamp = $timestamp;
$this->traceId = $traceId;
$this->level = $level;
$this->body = $body;
$this->attributes = new AttributeBag();
}
public function getTimestamp(): float
{
return $this->timestamp;
}
public function setTimestamp(float $timestamp): self
{
$this->timestamp = $timestamp;
return $this;
}
public function getTraceId(): string
{
return $this->traceId;
}
public function setTraceId(string $traceId): self
{
$this->traceId = $traceId;
return $this;
}
public function getLevel(): LogLevel
{
return $this->level;
}
public function setLevel(LogLevel $level): self
{
$this->level = $level;
return $this;
}
public function getPsrLevel(): string
{
return $this->level->toPsrLevel();
}
public function getBody(): string
{
return $this->body;
}
public function setBody(string $body): self
{
$this->body = $body;
return $this;
}
public function attributes(): AttributeBag
{
return $this->attributes;
}
/**
* @param mixed $value
*/
public function setAttribute(string $key, $value): self
{
$this->attributes->set($key, $value);
return $this;
}
}