1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace EightPoints\Bundle\GuzzleBundle\Log; |
4
|
|
|
|
5
|
|
|
class LogMessage |
6
|
|
|
{ |
7
|
|
|
/** @var string */ |
8
|
|
|
protected $message; |
9
|
|
|
|
10
|
|
|
/** @var string */ |
11
|
|
|
protected $level; |
12
|
|
|
|
13
|
|
|
/** @var \EightPoints\Bundle\GuzzleBundle\Log\LogRequest */ |
14
|
|
|
protected $request; |
15
|
|
|
|
16
|
|
|
/** @var \EightPoints\Bundle\GuzzleBundle\Log\LogResponse */ |
17
|
|
|
protected $response; |
18
|
|
|
|
19
|
|
|
/** @var null|float */ |
20
|
|
|
protected $transferTime; |
21
|
|
|
|
22
|
|
|
/** @var null|string */ |
23
|
|
|
protected $curlCommand; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param string $message |
27
|
|
|
*/ |
28
|
|
|
public function __construct($message) |
29
|
|
|
{ |
30
|
|
|
$this->message = $message; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Set log level |
35
|
|
|
* |
36
|
|
|
* @param string $level |
37
|
|
|
* |
38
|
|
|
* @return void |
39
|
|
|
*/ |
40
|
|
|
public function setLevel($level) : void |
41
|
|
|
{ |
42
|
|
|
$this->level = $level; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Returning log level |
47
|
|
|
* |
48
|
|
|
* @return string |
49
|
|
|
*/ |
50
|
|
|
public function getLevel() |
51
|
|
|
{ |
52
|
|
|
return $this->level; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Returning log message |
57
|
|
|
* |
58
|
|
|
* @return string |
59
|
|
|
*/ |
60
|
|
|
public function getMessage() |
61
|
|
|
{ |
62
|
|
|
return $this->message; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Set Log Request |
67
|
|
|
* |
68
|
|
|
* @param \EightPoints\Bundle\GuzzleBundle\Log\LogRequest $value |
69
|
|
|
* |
70
|
|
|
* @return void |
71
|
|
|
*/ |
72
|
|
|
public function setRequest(LogRequest $value) : void |
73
|
|
|
{ |
74
|
|
|
$this->request = $value; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Get Log Request |
79
|
|
|
* |
80
|
|
|
* @return \EightPoints\Bundle\GuzzleBundle\Log\LogRequest |
81
|
|
|
*/ |
82
|
|
|
public function getRequest() |
83
|
|
|
{ |
84
|
|
|
return $this->request; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Set Log Response |
89
|
|
|
* |
90
|
|
|
* @param \EightPoints\Bundle\GuzzleBundle\Log\LogResponse $value |
91
|
|
|
* |
92
|
|
|
* @return void |
93
|
|
|
*/ |
94
|
|
|
public function setResponse(LogResponse $value) |
95
|
|
|
{ |
96
|
|
|
$this->response = $value; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Get Log Response |
101
|
|
|
* |
102
|
|
|
* @return \EightPoints\Bundle\GuzzleBundle\Log\LogResponse |
103
|
|
|
*/ |
104
|
|
|
public function getResponse() |
105
|
|
|
{ |
106
|
|
|
return $this->response; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @return float|null |
111
|
|
|
*/ |
112
|
|
|
public function getTransferTime() |
113
|
|
|
{ |
114
|
|
|
return $this->transferTime; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @param float|null $transferTime |
119
|
|
|
* |
120
|
|
|
* @return void |
121
|
|
|
*/ |
122
|
|
|
public function setTransferTime($transferTime) : void |
123
|
|
|
{ |
124
|
|
|
$this->transferTime = $transferTime; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return null|string |
129
|
|
|
*/ |
130
|
|
|
public function getCurlCommand() |
131
|
|
|
{ |
132
|
|
|
return $this->curlCommand; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param string $curlCommand |
137
|
|
|
* |
138
|
|
|
* @return void |
139
|
|
|
*/ |
140
|
|
|
public function setCurlCommand($curlCommand) : void |
141
|
|
|
{ |
142
|
|
|
$this->curlCommand = $curlCommand; |
143
|
|
|
} |
144
|
|
|
} |
145
|
|
|
|