From d2db326cbf98d82a6af55e13f812612aec071194 Mon Sep 17 00:00:00 2001 From: psquickitjayant Date: Wed, 12 Aug 2015 19:18:31 +0530 Subject: [PATCH 1/2] Added an option to set tag via constructor --- .../com/github/tony19/loggly/LogglyClient.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/tony19/loggly/LogglyClient.java b/src/main/java/com/github/tony19/loggly/LogglyClient.java index b607d4a..ea3668b 100644 --- a/src/main/java/com/github/tony19/loggly/LogglyClient.java +++ b/src/main/java/com/github/tony19/loggly/LogglyClient.java @@ -25,19 +25,19 @@ /** * Loggly client - * + * * @author tony19@gmail.com */ public class LogglyClient implements ILogglyClient { private static final String API_URL = "http://logs-01.loggly.com/"; private final ILogglyRestService loggly; - private final String token; - private String tags; + private String token; + private String tags = "android"; /** * Creates a Loggly client * @param token Loggly customer token - * http://loggly.com/docs/customer-token-authentication-token/ + * http://loggly.com/docs/customer-token-authentication-token/tag/android */ public LogglyClient(String token) { if (token == null || token.isEmpty()) { @@ -52,6 +52,16 @@ public LogglyClient(String token) { this.loggly = restAdapter.create(ILogglyRestService.class); } + /** + * Creates a Loggly client + * @param token Loggly customer token + * http://loggly.com/docs/customer-token-authentication-token/tag/my-custom-tag + */ + public LogglyClient(String token, String tag) { + this(token); + this.tags = tag; + } + /** * Creates a Loggly client with the specified REST API. * This is package private for internal testing only. From 4dbfb989bd7f0e564ded0d0dbc8c47d75691bdfa Mon Sep 17 00:00:00 2001 From: psquickitjayant Date: Mon, 31 Aug 2015 19:27:26 +0530 Subject: [PATCH 2/2] Removed extra tag constructor --- .../com/github/tony19/loggly/LogglyClient.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/github/tony19/loggly/LogglyClient.java b/src/main/java/com/github/tony19/loggly/LogglyClient.java index ea3668b..5e5d69e 100644 --- a/src/main/java/com/github/tony19/loggly/LogglyClient.java +++ b/src/main/java/com/github/tony19/loggly/LogglyClient.java @@ -25,14 +25,14 @@ /** * Loggly client - * + * * @author tony19@gmail.com */ public class LogglyClient implements ILogglyClient { private static final String API_URL = "http://logs-01.loggly.com/"; - private final ILogglyRestService loggly; - private String token; - private String tags = "android"; + private ILogglyRestService loggly; + private final String token; + private String tags; /** * Creates a Loggly client @@ -52,15 +52,7 @@ public LogglyClient(String token) { this.loggly = restAdapter.create(ILogglyRestService.class); } - /** - * Creates a Loggly client - * @param token Loggly customer token - * http://loggly.com/docs/customer-token-authentication-token/tag/my-custom-tag - */ - public LogglyClient(String token, String tag) { - this(token); - this.tags = tag; - } + /** * Creates a Loggly client with the specified REST API.