use of com.dtflys.forest.logging.ResponseLogMessage in project forest by dromara.
the class SyncHttpclientRequestSender method logResponse.
public void logResponse(ForestResponse response) {
LogConfiguration logConfiguration = request.getLogConfiguration();
if (!logConfiguration.isLogEnabled() || response.isLogged()) {
return;
}
response.setLogged(true);
ResponseLogMessage logMessage = new ResponseLogMessage(response, response.getStatusCode());
ForestLogHandler logHandler = logConfiguration.getLogHandler();
if (logHandler != null) {
if (logConfiguration.isLogResponseStatus()) {
logHandler.logResponseStatus(logMessage);
}
if (logConfiguration.isLogResponseContent()) {
logHandler.logResponseContent(logMessage);
}
}
}
use of com.dtflys.forest.logging.ResponseLogMessage in project forest by dromara.
the class OkHttp3Executor method logResponse.
public void logResponse(ForestResponse response) {
LogConfiguration logConfiguration = request.getLogConfiguration();
if (!logConfiguration.isLogEnabled() || response.isLogged()) {
return;
}
response.setLogged(true);
ResponseLogMessage logMessage = new ResponseLogMessage(response, response.getStatusCode());
ForestLogHandler logHandler = logConfiguration.getLogHandler();
if (logHandler != null) {
if (logConfiguration.isLogResponseStatus()) {
logHandler.logResponseStatus(logMessage);
}
if (logConfiguration.isLogResponseContent()) {
logHandler.logResponseContent(logMessage);
}
}
}
Aggregations