title: Log not working in AsyncTask
body: <p>code for registering using asynctask :</p>
  
  <pre><code>import java.io.IOException;
  import android.content.Context;
  import android.content.SharedPreferences;  
  import android.os.AsyncTask;
  import android.util.Log;
  import android.widget.Toast;
  import com.google.android.gms.gcm.GoogleCloudMessaging;
  public class RegisterApp extends AsyncTask&lt;Void, Void, String&gt; {
  
      private static final String TAG = "GCMRelated";
      Context ctx;
      GoogleCloudMessaging gcm;
      String SENDER_ID = "10413";
      String regid = null; 
      private int appVersion;
  
  
      public RegisterApp(Context ctx, GoogleCloudMessaging gcm, int appVersion){
          this.ctx = ctx;
          this.gcm = gcm;
          this.appVersion = appVersion;
      }
  
      @Override
      protected void onPreExecute() {
          // TODO Auto-generated method stub
          super.onPreExecute();
      }
  
      @Override
      protected String doInBackground(Void... params) {
          String msg = "";
          try{
              if (gcm == null){
                  gcm = GoogleCloudMessaging.getInstance(ctx);
              }
              regid = gcm.register(SENDER_ID);
              msg = "Device registered, registration ID=" + regid;
              Log.i(TAG,msg);
  
          } catch (IOException e){
              msg = "Error: " + e.getMessage();
          }
  
          return msg;
      }
  
  
      @Override
      protected void onPostExecute(String result) {
          super.onPostExecute(result);
          Toast.makeText(ctx, 
            "Registration Completed. Now you can see the notifications", 
            Toast.LENGTH_SHORT)
            .show();
            Log.v(TAG, result); 
      }
  }
  </code></pre>
  
  <p>Here <code>toast</code> is working in <code>onPostExecute()</code> but Log is not working anywhere.what i am trying to show is <code>result</code> and <code>msg</code> in Logcat.</p>
  
  <p>More to know is where can i define log to place in information in Logcat? Do I have to do it in main UI thread or it can be done from anywhere in android system?</p>
  
  <p>Here is Logcat:
  <img src="https://i.stack.imgur.com/4KMy2.png" alt="enter image description here"></p>