package com.noveogroup.clap.test;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import java.text.DateFormat;
import java.util.Date;

// todo uncomment logic when clap-api will be introduced
public class TestActivity extends Activity {

    // @Trace
    private String test(String input) {
        return String.format("[%s]", input);
    }

    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        findViewById(R.id.button_crash).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                throw new RuntimeException("test crash");
            }
        });

        findViewById(R.id.button_test).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                test(DateFormat.getDateTimeInstance().format(new Date()));
            }
        });

        TextView infoView = (TextView) findViewById(R.id.info);
//        infoView.setText(String.format("projectId: %s\n"
//                        + "serverUrl: %s\n"
//                        + "username: %s\n"
//                        + "password: %s\n"
//                        + "source hash: %s\n",
//                BuildConfigHelper.get(getPackageName(), BuildConfigHelper.FIELD_CLAP_PROJECT_ID),
//                BuildConfigHelper.get(getPackageName(), BuildConfigHelper.FIELD_CLAP_SERVER_URL),
//                BuildConfigHelper.get(getPackageName(), BuildConfigHelper.FIELD_CLAP_USERNAME),
//                BuildConfigHelper.get(getPackageName(), BuildConfigHelper.FIELD_CLAP_PASSWORD),
//                BuildConfigHelper.get(getPackageName(), BuildConfigHelper.FIELD_CLAP_SOURCE_HASH)
//        ));
    }

}

@@ -83,16 +83,41 @@
 Bundle;%0A
+import android.util.Log;%0A
 import a
@@ -134,16 +134,16 @@
 w.View;%0A
-
 import a
@@ -323,16 +323,944 @@
 vity %7B%0A%0A
+    private static void log() %7B%0A        Log.v(%22LOG%22, %22v(String, String)%22);%0A        Log.v(%22LOG%22, %22v(String, String, Throwable)%22, new Exception());%0A        Log.d(%22LOG%22, %22d(String, String)%22);%0A        Log.d(%22LOG%22, %22d(String, String, Throwable)%22, new Exception());%0A        Log.i(%22LOG%22, %22i(String, String)%22);%0A        Log.i(%22LOG%22, %22i(String, String, Throwable)%22, new Exception());%0A        Log.w(%22LOG%22, %22w(String, String)%22);%0A        Log.w(%22LOG%22, new Exception(%22w(String, Throwable)%22));%0A        Log.w(%22LOG%22, %22w(String, String, Throwable)%22, new Exception());%0A        Log.e(%22LOG%22, %22e(String, String)%22);%0A        Log.e(%22LOG%22, %22e(String, String, Throwable)%22, new Exception());%0A        Log.wtf(%22LOG%22, %22wtf(String, String)%22);%0A        Log.wtf(%22LOG%22, new Exception(%22wtf(String, Throwable)%22));%0A        Log.wtf(%22LOG%22, %22wtf(String, String, Throwable)%22, new Exception());%0A        Log.println(Log.DEBUG, %22LOG%22, %22println(int, String, String)%22);%0A    %7D%0A%0A
     // @
@@ -1621,32 +1621,32 @@
       @Override%0A
-
             publ
@@ -1666,32 +1666,55 @@
 ck(View view) %7B%0A
+                log();%0A
                 

test logs