Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated LogglyClient.java for tag support #1

Closed
wants to merge 7 commits into from

Fixed Whitespace issues

  • Loading branch information
varshneyjayant committed Aug 12, 2015
commit c6cd0cace37eb4d1ace851fac4fb23d79257cc79
@@ -27,7 +27,6 @@

/**
* Loggly client
*
* @author tony19@gmail.com
*/
public class LogglyClient implements ILogglyClient {
@@ -48,7 +47,8 @@ public LogglyClient(String token) {
}

RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint(API_URL).build();
.setEndpoint(API_URL)
.build();

this.token = token;
this.loggly = restAdapter.create(ILogglyRestService.class);
@@ -67,20 +67,19 @@ public LogglyClient(String token, String tag) {
}

/**
* Creates a Loggly client with the specified REST API.
* Creates a Loggly client with the specified REST API.
* This is package private for internal testing only.
* @param token Loggly customer token
* @param restApi
* implementation of {@link ILogglyRestService}
* @param restApi implementation of {@link ILogglyRestService}
*/
LogglyClient(String token, ILogglyRestService restApi) {
this.token = token;
this.loggly = restApi;
}

/**
* Sets the tags to use for Loggly messages. The list of
* strings are converted into a single CSV (trailing/leading
* Sets the tags to use for Loggly messages. The list of
* strings are converted into a single CSV (trailing/leading
* spaces stripped from each entry).
* @param tags CSV or list of tags
*/
@@ -125,8 +124,7 @@ public boolean log(String message) {
/**
* Posts a log message asynchronously to Loggly
* @param message message to be logged
* @param callback
* callback to be invoked on completion of the post
* @param callback callback to be invoked on completion of the post
*/

public void log(String message, final Callback callback) {
@@ -135,7 +133,7 @@ public void log(String message, final Callback callback) {
loggly.log(token,
tags,
new TypedString(message),
new retrofit.Callback<LogglyResponse> () {
new retrofit.Callback<LogglyResponse>() {
public void success(LogglyResponse logglyResponse, Response response) {
callback.success();
}
@@ -191,10 +189,10 @@ public void logBulk(Collection<String> messages, final Callback callback) {
loggly.logBulk(token,
tags,
new TypedString(parcel),
new retrofit.Callback<LogglyResponse> () {
new retrofit.Callback<LogglyResponse>() {
public void success(LogglyResponse logglyResponse,Response response) {
callback.success();
}
callback.success();
}

public void failure(RetrofitError retrofitError) {
callback.failure(retrofitError.getMessage());
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.