Android Open Source - cloudwave Log Utils






From Project

Back to project page cloudwave.

License

The source code is released under:

Apache License

If you think the Android project cloudwave listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.luboganev.cloudwave;
//ww  w .  j a v a  2 s  .c  o m
import android.util.Log;

/**
 * Useful class which logs debug or error messages 
 * under a specific TAG when in debug mode
 */
public class LogUtils {
  public static final String TAG = "CloudWave";
  
  /**
   *   This variable defines the current mode of the application. 
   *   When it is being released, the debug mode will be set to false.
   */
  public static final boolean DEBUG = false;
  
  /**
   *   Prints a debug message in the system log
   * 
   * @param sender
   *     A string with custom name or a class
   * @param message
   *     The message to be logged
   */
  public static void d(Object sender, String message) {
    if(DEBUG) Log.d(TAG,  getSenderString(sender) + ": " + message);
  }
  
  /**
   *   Prints an error message in the system log
   * 
   * @param sender
   *     A string with custom name or a class
   * @param message
   *     The message to be logged
   */
  public static void e(Object sender, String message) {
    if(DEBUG) Log.e(TAG,  getSenderString(sender) + ": " + message);
  }
  
  /**
   * Gets the name of the Class of the input object
   * 
   * @param sender
   *     The input object 
   * @return
   */
  private static String getSenderString(Object sender) {
    if(sender instanceof String) {
      return (String)sender;
    }
    else return sender.getClass().getSimpleName();
  }
}




Java Source Code List

com.luboganev.cloudwave.CloudWaveWallpaper.java
com.luboganev.cloudwave.LogUtils.java
com.luboganev.cloudwave.data.LocalStorageManager.java
com.luboganev.cloudwave.data.LocalStorage.java
com.luboganev.cloudwave.data.Track.java
com.luboganev.cloudwave.receivers.AlarmReceiver.java
com.luboganev.cloudwave.receivers.ConnectivityChangeReceiver.java
com.luboganev.cloudwave.service.ChangeWallpaperService.java
com.luboganev.cloudwave.service.CommunicationUtils.java