Hello World

My first post, so Hi All!

A simple idea to work with logs. This way by its clearness can increase the developing speed. To be tested in practice.

Fast – logd + add arguments + home + C and that’s all

Clearness – an easy way to get a log in form – “start: = [Hello World], post = [1]”

Others – null proof

This way?
int i = 1;
String textToShow = "Hello World";
Log.d(TAG, "start: = [ " + textToShow + " ], "+ "post = [ " + i + " ]");
a
Or this way?
int i = 1;
String textToShow = "Hello World";
CLog.d(TAG, "start: ", textToShow, "post", i);

public void CLog {
    public static <T, S> void d(String TAG, String info, T t, String info2, S s) {
        String s1 = null;
        String s2 = null;
        if (t != null) s1 = t.toString();
        if (s != null) s2 = s.toString();
        Log.d(TAG, info + " = [" + s1 + "], " + info2 + " = [" + s2 + "]");
    }
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s