Merge branch 'stable-2.16' into stable-3.0
* stable-2.16: TestSubmitType: Enable logErrors when debug logging is enabled TestSubmitRule: Enable logErrors when debug logging is enabled Fix typos in test.submit_rule and test.submit_type examples RestApiServlet: Log JSON parse error at debug level Change-Id: I04a240a36382d84b3ec7794ed0f0a339dcc90788
This commit is contained in:
@@ -555,6 +555,7 @@ public class RestApiServlet extends HttpServlet {
|
||||
}
|
||||
}
|
||||
} catch (MalformedJsonException | JsonParseException e) {
|
||||
logger.atFine().withCause(e).log("REST call failed on JSON parsing");
|
||||
responseBytes =
|
||||
replyError(
|
||||
req, res, status = SC_BAD_REQUEST, "Invalid " + JSON_TYPE + " in request", e);
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.google.gerrit.server.restapi.change;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.gerrit.common.data.SubmitRecord;
|
||||
import com.google.gerrit.extensions.common.AccountInfo;
|
||||
import com.google.gerrit.extensions.common.TestSubmitRuleInfo;
|
||||
@@ -41,6 +42,8 @@ import java.util.List;
|
||||
import org.kohsuke.args4j.Option;
|
||||
|
||||
public class TestSubmitRule implements RestModifyView<RevisionResource, TestSubmitRuleInput> {
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
private final ChangeData.Factory changeDataFactory;
|
||||
private final RulesCache rules;
|
||||
private final AccountLoader.Factory accountInfoFactory;
|
||||
@@ -82,7 +85,7 @@ public class TestSubmitRule implements RestModifyView<RevisionResource, TestSubm
|
||||
SubmitRuleOptions.builder()
|
||||
.skipFilters(input.filters == Filters.SKIP)
|
||||
.rule(input.rule)
|
||||
.logErrors(false)
|
||||
.logErrors(logger.atFine().isEnabled())
|
||||
.build();
|
||||
|
||||
ProjectState projectState = projectCache.get(rsrc.getProject());
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.server.restapi.change;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.gerrit.common.data.SubmitTypeRecord;
|
||||
import com.google.gerrit.extensions.client.SubmitType;
|
||||
import com.google.gerrit.extensions.common.TestSubmitRuleInput;
|
||||
@@ -32,6 +33,8 @@ import com.google.inject.Inject;
|
||||
import org.kohsuke.args4j.Option;
|
||||
|
||||
public class TestSubmitType implements RestModifyView<RevisionResource, TestSubmitRuleInput> {
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
private final ChangeData.Factory changeDataFactory;
|
||||
private final RulesCache rules;
|
||||
private final SubmitRuleEvaluator.Factory submitRuleEvaluatorFactory;
|
||||
@@ -62,7 +65,7 @@ public class TestSubmitType implements RestModifyView<RevisionResource, TestSubm
|
||||
|
||||
SubmitRuleOptions opts =
|
||||
SubmitRuleOptions.builder()
|
||||
.logErrors(false)
|
||||
.logErrors(logger.atFine().isEnabled())
|
||||
.skipFilters(input.filters == Filters.SKIP)
|
||||
.rule(input.rule)
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user