Skip to content

Commit 7d4ef27

Browse files
committed
Add silent parameter to the error log
1 parent 87f4761 commit 7d4ef27

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

library/src/main/java/me/proxer/library/api/apps/ErrorLogEndpoint.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public final class ErrorLogEndpoint implements Endpoint<Void> {
2727
@Setter
2828
private Boolean anonym;
2929

30+
/**
31+
* Sets if the developer should get a notification. If not set, this behaves as true.
32+
*/
33+
@Nullable
34+
@Setter
35+
private Boolean silent;
36+
3037
ErrorLogEndpoint(final InternalApi internalApi, final String id, final String message) {
3138
this.internalApi = internalApi;
3239
this.id = id;
@@ -38,6 +45,6 @@ public final class ErrorLogEndpoint implements Endpoint<Void> {
3845
*/
3946
@Override
4047
public ProxerCall<Void> build() {
41-
return internalApi.errorLog(id, message, anonym);
48+
return internalApi.errorLog(id, message, anonym, silent);
4249
}
4350
}

library/src/main/java/me/proxer/library/api/apps/InternalApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ public interface InternalApi {
1717
@POST("apps/errorlog")
1818
ProxerCall<Void> errorLog(@Field("id") String id,
1919
@Field("message") String message,
20-
@Field("anonym") Boolean anonym);
20+
@Field("anonym") Boolean anonym,
21+
@Field("silent") Boolean silent);
2122
}

library/src/test/java/me/proxer/library/api/apps/ErrorLogEndpointTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ public void testParameters() throws IOException, ProxerException, InterruptedExc
4040

4141
api.apps().errorLog("3", "test message")
4242
.anonym(false)
43+
.silent(false)
4344
.build()
4445
.execute();
4546

46-
assertThat(server.takeRequest().getBody().readUtf8()).isEqualTo("id=3&message=test%20message&anonym=false");
47+
assertThat(server.takeRequest().getBody().readUtf8())
48+
.isEqualTo("id=3&message=test%20message&anonym=false&silent=false");
4749
}
4850
}

0 commit comments

Comments
 (0)