Example usage for android.util Log ERROR

List of usage examples for android.util Log ERROR

Introduction

In this page you can find the example usage for android.util Log ERROR.

Prototype

int ERROR

To view the source code for android.util Log ERROR.

Click Source Link

Document

Priority constant for the println method; use Log.e.

Usage

From source file:Main.java

/**
 * This is an expensive operation that copies the image in place with the pixels rotated. If
 * possible rather use getOrientationMatrix, and put that as the imageMatrix on an ImageView.
 *
 * @param imageToOrient   Image Bitmap to orient.
 * @param degreesToRotate number of degrees to rotate the image by. If zero the original image is
 *                        returned unmodified.
 * @return The oriented bitmap. May be the imageToOrient without modification, or a new Bitmap.
 *///from w  w w  . ja  v a  2s  .c  o  m
public static Bitmap rotateImage(@NonNull Bitmap imageToOrient, int degreesToRotate) {
    Bitmap result = imageToOrient;
    try {
        if (degreesToRotate != 0) {
            Matrix matrix = new Matrix();
            matrix.setRotate(degreesToRotate);
            result = Bitmap.createBitmap(imageToOrient, 0, 0, imageToOrient.getWidth(),
                    imageToOrient.getHeight(), matrix, true /*filter*/);
        }
    } catch (Exception e) {
        if (Log.isLoggable(TAG, Log.ERROR)) {
            Log.e(TAG, "Exception when trying to orient image", e);
        }
    }
    return result;
}

From source file:Main.java

private static void print(int mode, final String tag, String msg) {
    if (!isPrint) {
        return;/*from w  w  w  .  j a v  a 2  s.  c  o  m*/
    }
    if (msg == null) {
        Log.e(tag, MSG);
        return;
    }
    switch (mode) {
    case Log.VERBOSE:
        Log.v(tag, msg);
        break;
    case Log.DEBUG:
        Log.d(tag, msg);
        break;
    case Log.INFO:
        Log.i(tag, msg);
        break;
    case Log.WARN:
        Log.w(tag, msg);
        break;
    case Log.ERROR:
        Log.e(tag, msg);
        break;
    default:
        Log.d(tag, msg);
        break;
    }
}

From source file:Main.java

public static void e(String tag, String msg) {
    print(Log.ERROR, tag, msg);
}

From source file:Main.java

public static void e(String msg) {
    if (isLog) {
        log(DEFAULT_TAG, Log.ERROR, msg, null);
    }
}

From source file:com.cbsb.ftpserv.Util.java

/**
 * Get the SwiFTP version from the manifest.
 * @return The version as a String.//from  www.j a v a  2  s.  com
 */
public static String getVersion() {
    String packageName = Globals.getContext().getPackageName();
    try {
        return Globals.getContext().getPackageManager().getPackageInfo(packageName, 0).versionName;
    } catch (NameNotFoundException e) {
        myLog.l(Log.ERROR, "NameNotFoundException looking up RiseFTP server version");
        return null;
    }
}

From source file:org.fusioninventory.utils.EasySSLSocketFactory.java

private static SSLContext createEasySSLContext() throws IOException {
    FusionInventory.log(EasySSLSocketFactory.class, "Create Easy SSL Context", Log.ERROR);
    try {/* www.ja  v  a 2  s  .co m*/
        SSLContext context = SSLContext.getInstance("TLS");
        context.init(null, new TrustManager[] { new EasyX509TrustManager(null) }, null);
        return context;
    } catch (Exception e) {
        throw new IOException(e.getMessage());
    }
}

From source file:com.example.lenovo.networktools.widget.ftp.swiftp.Util.java

/**
 * Get the SwiFTP version from the manifest.
 * @return The version as a String./*from w ww.j a va2 s. c  om*/
 */
public static String getVersion() {
    String packageName = Globals.getContext().getPackageName();
    try {
        return Globals.getContext().getPackageManager().getPackageInfo(packageName, 0).versionName;
    } catch (NameNotFoundException e) {
        myLog.l(Log.ERROR, "NameNotFoundException looking up SwiFTP version");
        return null;
    }
}

From source file:com.android.utils.FocusFinder.java

public static AccessibilityNodeInfoCompat getFocusedNode(AccessibilityService service, boolean fallbackOnRoot) {
    AccessibilityNodeInfo root = service.getRootInActiveWindow();
    AccessibilityNodeInfo focused = null;

    try {//from  www  .ja va  2 s  .com
        AccessibilityNodeInfo ret = null;
        if (root != null) {
            focused = root.findFocus(AccessibilityNodeInfo.FOCUS_ACCESSIBILITY);
            if (focused != null && focused.isVisibleToUser()) {
                ret = focused;
                focused = null;
            } else if (fallbackOnRoot) {
                ret = root;
                root = null;
            }
        } else {
            LogUtils.log(service, Log.ERROR, "No current window root");
        }

        if (ret != null) {
            return new AccessibilityNodeInfoCompat(ret);
        }
    } finally {
        if (root != null) {
            root.recycle();
        }

        if (focused != null) {
            focused.recycle();
        }
    }

    return null;
}

From source file:Main.java

/**
 * Logs provided logText in provided tag at given logLevel (like, android.util.Log.DEBUG)
 * @param logLevel int VERBOSE, DEBUG, INFO, WARN, ERROR
 * @param tag String/* w ww .  j  a v  a2  s  .  c om*/
 * @param logText String
 */
public static void log(int logLevel, String tag, String logText) {
    switch (logLevel) {
    case Log.VERBOSE:
        Log.v(tag, logText);
        break;

    case Log.DEBUG:
        Log.d(tag, logText);
        break;

    case Log.INFO:
        Log.i(tag, logText);
        break;

    case Log.WARN:
        Log.w(tag, logText);
        break;

    case Log.ERROR:
        Log.e(tag, logText);
        break;
    }
}

From source file:com.digipom.manteresting.android.service.cache.BitmapMemoryCache.java

private static final int getByteCountHoneyCombMr1(Bitmap bitmap) {
    try {//  w  ww.  j  av a2  s . c om
        final Integer byteCount = (Integer) getByteCount.invoke(bitmap, (Object[]) null);
        return byteCount;
    } catch (Exception e) {
        if (LoggerConfig.canLog(Log.ERROR)) {
            Log.e(TAG, "Reflection call failed.", e);
        }

        return -1;
    }
}