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.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -29,6 +28,7 @@ import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.data.TopicSummary; import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager; import gr.thmmy.mthmmy.session.SessionManager;
import gr.thmmy.mthmmy.utils.CustomRecyclerView; import gr.thmmy.mthmmy.utils.CustomRecyclerView;
import mthmmy.utils.Report;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
@ -94,7 +94,7 @@ public class ForumFragment extends Fragment
if (sectionNumber == 1) //? if (sectionNumber == 1) //?
Log.d(TAG, "onCreate"); Report.d(TAG, "onCreate");
} }
@Override @Override
@ -107,35 +107,35 @@ public class ForumFragment extends Fragment
} }
Log.d(TAG, "onActivityCreated"); Report.d(TAG, "onActivityCreated");
} }
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onStart"); Report.d(TAG, "onStart");
} }
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onResume"); Report.d(TAG, "onResume");
} }
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onPause"); Report.d(TAG, "onPause");
} }
@Override @Override
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onStop"); Report.d(TAG, "onStop");
} }
@ -226,10 +226,10 @@ public class ForumFragment extends Fragment
parse(document); parse(document);
return 0; return 0;
} catch (IOException e) { } catch (IOException e) {
Log.d("DEB", "ERROR", e); Report.d("DEB", "ERROR", e);
return 1; return 1;
} catch (Exception e) { } catch (Exception e) {
Log.d("DEB", "ERROR", e); Report.d("DEB", "ERROR", e);
return 2; return 2;
} }
@ -262,7 +262,7 @@ public class ForumFragment extends Fragment
if (matcher.find()) if (matcher.find())
lastUser = matcher.group(1); lastUser = matcher.group(1);
else { else {
Log.e(TAG, "Parsing failed (lastUser)!"); Report.e(TAG, "Parsing failed (lastUser)!");
return; return;
} }
@ -272,7 +272,7 @@ public class ForumFragment extends Fragment
if (matcher.find()) if (matcher.find())
dateTime = matcher.group(1); dateTime = matcher.group(1);
else { else {
Log.e(TAG, "Parsing failed (dateTime)!"); Report.e(TAG, "Parsing failed (dateTime)!");
return; return;
} }
@ -282,7 +282,7 @@ public class ForumFragment extends Fragment
return; 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.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -29,6 +28,7 @@ import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.data.TopicSummary; import gr.thmmy.mthmmy.data.TopicSummary;
import gr.thmmy.mthmmy.session.SessionManager; import gr.thmmy.mthmmy.session.SessionManager;
import gr.thmmy.mthmmy.utils.CustomRecyclerView; import gr.thmmy.mthmmy.utils.CustomRecyclerView;
import mthmmy.utils.Report;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
@ -93,7 +93,7 @@ public class RecentFragment extends Fragment {
if (sectionNumber == 1) //? if (sectionNumber == 1) //?
Log.d(TAG, "onCreate"); Report.d(TAG, "onCreate");
} }
@Override @Override
@ -106,35 +106,35 @@ public class RecentFragment extends Fragment {
} }
Log.d(TAG, "onActivityCreated"); Report.d(TAG, "onActivityCreated");
} }
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onStart"); Report.d(TAG, "onStart");
} }
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onResume"); Report.d(TAG, "onResume");
} }
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onPause"); Report.d(TAG, "onPause");
} }
@Override @Override
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
if (sectionNumber == 1) if (sectionNumber == 1)
Log.d(TAG, "onStop"); Report.d(TAG, "onStop");
} }
@ -225,10 +225,10 @@ public class RecentFragment extends Fragment {
parse(document); parse(document);
return 0; return 0;
} catch (IOException e) { } catch (IOException e) {
Log.d("DEB", "ERROR", e); Report.d("DEB", "ERROR", e);
return 1; return 1;
} catch (Exception e) { } catch (Exception e) {
Log.d("DEB", "ERROR", e); Report.d("DEB", "ERROR", e);
return 2; return 2;
} }
@ -261,7 +261,7 @@ public class RecentFragment extends Fragment {
if (matcher.find()) if (matcher.find())
lastUser = matcher.group(1); lastUser = matcher.group(1);
else { else {
Log.e(TAG, "Parsing failed (lastUser)!"); Report.e(TAG, "Parsing failed (lastUser)!");
return; return;
} }
@ -271,7 +271,7 @@ public class RecentFragment extends Fragment {
if (matcher.find()) if (matcher.find())
dateTime = matcher.group(1); dateTime = matcher.group(1);
else { else {
Log.e(TAG, "Parsing failed (dateTime)!"); Report.e(TAG, "Parsing failed (dateTime)!");
return; return;
} }
@ -281,7 +281,7 @@ public class RecentFragment extends Fragment {
return; 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.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@ -35,6 +34,7 @@ import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.BaseActivity; import gr.thmmy.mthmmy.activities.BaseActivity;
import gr.thmmy.mthmmy.activities.LoginActivity; import gr.thmmy.mthmmy.activities.LoginActivity;
import gr.thmmy.mthmmy.data.Post; import gr.thmmy.mthmmy.data.Post;
import mthmmy.utils.Report;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
@ -342,9 +342,9 @@ public class TopicActivity extends BaseActivity {
parse(document); //Parse data parse(document); //Parse data
return true; return true;
} catch (SSLHandshakeException e) { } 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) { } catch (Exception e) {
Log.e("TAG", "ERROR", e); Report.e("TAG", "ERROR", e);
} }
return false; return false;
} }
@ -385,7 +385,7 @@ public class TopicActivity extends BaseActivity {
} else { } else {
parsedTitle = parsedTitle.substring(parsedTitle.indexOf("Θέμα:") + 6 parsedTitle = parsedTitle.substring(parsedTitle.indexOf("Θέμα:") + 6
, parsedTitle.indexOf("(Αναγνώστηκε") - 2); , 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.CardView;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@ -37,6 +36,7 @@ import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.data.Post; import gr.thmmy.mthmmy.data.Post;
import gr.thmmy.mthmmy.utils.CircleTransform; import gr.thmmy.mthmmy.utils.CircleTransform;
import gr.thmmy.mthmmy.utils.FontManager; import gr.thmmy.mthmmy.utils.FontManager;
import mthmmy.utils.Report;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static gr.thmmy.mthmmy.activities.topic.TopicActivity.NO_POST_FOCUS; 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())); toQuoteList.remove(toQuoteList.indexOf(currentPost.getPostNumber()));
view.setSelected(false); view.setSelected(false);
} else } 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!"); "toQuoteList, post wasn't there!");
} else { } else {
toQuoteList.add(currentPost.getPostNumber()); toQuoteList.add(currentPost.getPostNumber());
@ -443,7 +443,7 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
private boolean handleUri(final Uri uri) { private boolean handleUri(final Uri uri) {
//Method always returns true as we don't want any url to be loaded in WebViews //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 host = uri.getHost(); //Get requested url's host
final String uriString = uri.toString(); final String uriString = uri.toString();

Loading…
Cancel
Save