Message
class Message implements Serializable, JsonSerializable
Message class.
This class is a representation of a log message which contains API-related information and can easily be serialized.
Methods
__construct(string $api, float $duration, RequestInterface $request, ResponseInterface $response = null, Exception $exception = null)
Constructor.
static
createFromString(string $json)
Creates a new instance of the class from a JSON string.
getLogLevel()
No description
getApi()
No description
getRequest()
No description
Exception|null
getException()
No description
getDuration()
The duration in microseconds.
ResponseInterface|null
getResponse()
No description
isError()
True if the requests threw an error.
jsonSerialize()
{@inheritdoc}
serialize()
{@inheritdoc}
unserialize($serialized)
{@inheritdoc}
asString()
Returns a string representation of the current message.
__toString()
No description
Details
at line 59
__construct(string $api, float $duration, RequestInterface $request, ResponseInterface $response = null, Exception $exception = null)
Constructor.
at line 80
static
createFromString(string $json)
Creates a new instance of the class from a JSON string.
at line 103
getLogLevel()
at line 110
getApi()
at line 115
getRequest()
at line 123
Exception|null
getException()
at line 131
getDuration()
The duration in microseconds.
at line 139
ResponseInterface|null
getResponse()
at line 147
isError()
True if the requests threw an error.
at line 166
jsonSerialize()
{@inheritdoc}
at line 174
serialize()
{@inheritdoc}
at line 182
unserialize($serialized)
{@inheritdoc}
at line 196
asString()
Returns a string representation of the current message.