Browse Source

Replaced Log calls with Report

pull/24/head
Ezerous 8 years ago
parent
commit
7b28d47e33
  1. 24
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
  2. 24
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  3. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  4. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

24
app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java

@ -6,7 +6,6 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -29,6 +28,7 @@ import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager;
import gr.thmmy.mthmmy.utils.CustomRecyclerView;
import mthmmy.utils.Report;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
@ -94,7 +94,7 @@ public class ForumFragment extends Fragment
if (sectionNumber == 1) //?
Log.d(TAG, "onCreate");
Report.d(TAG, "onCreate");
}
@Override
@ -107,35 +107,35 @@ public class ForumFragment extends Fragment
}
Log.d(TAG, "onActivityCreated");
Report.d(TAG, "onActivityCreated");
}
@Override
public void onStart() {
super.onStart();
if (sectionNumber == 1)
Log.d(TAG, "onStart");
Report.d(TAG, "onStart");
}
@Override
public void onResume() {
super.onResume();
if (sectionNumber == 1)
Log.d(TAG, "onResume");
Report.d(TAG, "onResume");
}
@Override
public void onPause() {
super.onPause();
if (sectionNumber == 1)
Log.d(TAG, "onPause");
Report.d(TAG, "onPause");
}
@Override
public void onStop() {
super.onStop();
if (sectionNumber == 1)
Log.d(TAG, "onStop");
Report.d(TAG, "onStop");
}
@ -226,10 +226,10 @@ public class ForumFragment extends Fragment
parse(document);
return 0;
} catch (IOException e) {
Log.d("DEB", "ERROR", e);
Report.d("DEB", "ERROR", e);
return 1;
} catch (Exception e) {
Log.d("DEB", "ERROR", e);
Report.d("DEB", "ERROR", e);
return 2;
}
@ -262,7 +262,7 @@ public class ForumFragment extends Fragment
if (matcher.find())
lastUser = matcher.group(1);
else {
Log.e(TAG, "Parsing failed (lastUser)!");
Report.e(TAG, "Parsing failed (lastUser)!");
return;
}
@ -272,7 +272,7 @@ public class ForumFragment extends Fragment
if (matcher.find())
dateTime = matcher.group(1);
else {
Log.e(TAG, "Parsing failed (dateTime)!");
Report.e(TAG, "Parsing failed (dateTime)!");
return;
}
@ -282,7 +282,7 @@ public class ForumFragment extends Fragment
return;
}
Log.e(TAG, "Parsing failed!");
Report.e(TAG, "Parsing failed!");
}
}

24
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java

@ -6,7 +6,6 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -29,6 +28,7 @@ import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager;
import gr.thmmy.mthmmy.utils.CustomRecyclerView;
import mthmmy.utils.Report;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
@ -93,7 +93,7 @@ public class RecentFragment extends Fragment {
if (sectionNumber == 1) //?
Log.d(TAG, "onCreate");
Report.d(TAG, "onCreate");
}
@Override
@ -106,35 +106,35 @@ public class RecentFragment extends Fragment {
}
Log.d(TAG, "onActivityCreated");
Report.d(TAG, "onActivityCreated");
}
@Override
public void onStart() {
super.onStart();
if (sectionNumber == 1)
Log.d(TAG, "onStart");
Report.d(TAG, "onStart");
}
@Override
public void onResume() {
super.onResume();
if (sectionNumber == 1)
Log.d(TAG, "onResume");
Report.d(TAG, "onResume");
}
@Override
public void onPause() {
super.onPause();
if (sectionNumber == 1)
Log.d(TAG, "onPause");
Report.d(TAG, "onPause");
}
@Override
public void onStop() {
super.onStop();
if (sectionNumber == 1)
Log.d(TAG, "onStop");
Report.d(TAG, "onStop");
}
@ -225,10 +225,10 @@ public class RecentFragment extends Fragment {
parse(document);
return 0;
} catch (IOException e) {
Log.d("DEB", "ERROR", e);
Report.d("DEB", "ERROR", e);
return 1;
} catch (Exception e) {
Log.d("DEB", "ERROR", e);
Report.d("DEB", "ERROR", e);
return 2;
}
@ -261,7 +261,7 @@ public class RecentFragment extends Fragment {
if (matcher.find())
lastUser = matcher.group(1);
else {
Log.e(TAG, "Parsing failed (lastUser)!");
Report.e(TAG, "Parsing failed (lastUser)!");
return;
}
@ -271,7 +271,7 @@ public class RecentFragment extends Fragment {
if (matcher.find())
dateTime = matcher.group(1);
else {
Log.e(TAG, "Parsing failed (dateTime)!");
Report.e(TAG, "Parsing failed (dateTime)!");
return;
}
@ -281,7 +281,7 @@ public class RecentFragment extends Fragment {
return;
}
Log.e(TAG, "Parsing failed!");
Report.e(TAG, "Parsing failed!");
}
}

8
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java

@ -13,7 +13,6 @@ import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.util.SparseArray;
import android.view.MotionEvent;
import android.view.View;
@ -35,6 +34,7 @@ import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.activities.LoginActivity;
import gr.thmmy.mthmmy.data.Post;
import mthmmy.utils.Report;
import okhttp3.Request;
import okhttp3.Response;
@ -342,9 +342,9 @@ public class TopicActivity extends BaseActivity {
parse(document); //Parse data
return true;
} catch (SSLHandshakeException e) {
Log.w(TAG, "Certificate problem (please switch to unsafe connection).");
Report.w(TAG, "Certificate problem (please switch to unsafe connection).");
} catch (Exception e) {
Log.e("TAG", "ERROR", e);
Report.e("TAG", "ERROR", e);
}
return false;
}
@ -385,7 +385,7 @@ public class TopicActivity extends BaseActivity {
} else {
parsedTitle = parsedTitle.substring(parsedTitle.indexOf("Θέμα:") + 6
, parsedTitle.indexOf("(Αναγνώστηκε") - 2);
Log.d(TAG, parsedTitle);
Report.d(TAG, parsedTitle);
}
}

6
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -12,7 +12,6 @@ import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@ -37,6 +36,7 @@ import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.data.Post;
import gr.thmmy.mthmmy.utils.CircleTransform;
import gr.thmmy.mthmmy.utils.FontManager;
import mthmmy.utils.Report;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static gr.thmmy.mthmmy.activities.topic.TopicActivity.NO_POST_FOCUS;
@ -178,7 +178,7 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
toQuoteList.remove(toQuoteList.indexOf(currentPost.getPostNumber()));
view.setSelected(false);
} else
Log.i(TAG, "An error occurred while trying to exclude post from" +
Report.i(TAG, "An error occurred while trying to exclude post from" +
"toQuoteList, post wasn't there!");
} else {
toQuoteList.add(currentPost.getPostNumber());
@ -443,7 +443,7 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
private boolean handleUri(final Uri uri) {
//Method always returns true as we don't want any url to be loaded in WebViews
Log.i(TAG, "Uri clicked = " + uri);
Report.i(TAG, "Uri clicked = " + uri);
final String host = uri.getHost(); //Get requested url's host
final String uriString = uri.toString();

Loading…
Cancel
Save