public class StepLogger extends Object
| Constructor and Description |
|---|
StepLogger(OutputStream outputStream)
Create a new logger that outputs to the stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the logger output, writes code to close the array and opened object:
// ]
// }
|
void |
start()
Start the object streaming, outputs start of the JSON object:
// {
// "steps" : [
|
void |
writeDoneFailed()
Write information about incorrectly finished execution.
|
void |
writeDoneOK()
Write information about successfully finished execution.
|
void |
writeError(Exception exception)
Write error with given exception information.
|
void |
writeError(String errorMessage)
Write error with given error message.
|
void |
writeError(String name,
String errorMessage)
Write error with given error name and error message, that is used as a description.
|
void |
writeError(String name,
String errorMessage,
Exception exception) |
void |
writeItem(String name,
String description,
String status,
Object object)
Writes a JSON object representing the step of the execution.
|
void |
writeServerCall(String uri,
String method,
Object requestObject,
Map<String,?> headers)
Write the information about the server call.
|
void |
writeServerCallConnectionError(Exception e)
Write error in case of a network issues.
|
void |
writeServerCallError(int statusCode,
Object responseObject,
Map<String,?> headers)
Write information about the failed server request.
|
void |
writeServerCallOK(Object responseObject,
Map<String,?> headers)
Write information about the successful server request.
|
public StepLogger(OutputStream outputStream)
outputStream - Output stream.public void start()
public void writeItem(String name, String description, String status, Object object)
name - Step name.description - Step detailed description.status - Step status result.object - Custom object associated with the step.public void writeServerCall(String uri, String method, Object requestObject, Map<String,?> headers)
uri - URI that will be called.method - HTTP method of the call.requestObject - Request object, in case of the POST, PUT, DELETE method.headers - HTTP request headers.public void writeServerCallOK(Object responseObject, Map<String,?> headers)
responseObject - HTTP response object.headers - HTTP response headers.public void writeServerCallError(int statusCode,
Object responseObject,
Map<String,?> headers)
statusCode - HTTP response status code.responseObject - HTTP response object.headers - HTTP response headers.public void close()
public void writeServerCallConnectionError(Exception e)
e - Network exception.public void writeError(String errorMessage)
errorMessage - Error message.public void writeError(Exception exception)
exception - Exception that should be logged.public void writeError(String name, String errorMessage)
name - Error name.errorMessage - Error message.public void writeDoneOK()
public void writeDoneFailed()
Copyright © 2016–2017 Lime - HighTech Solutions Inc.. All rights reserved.