APISonar


android.util.Log.WARN

> android > util > Log > WARN
android APIs util APIs Log APIs WARN APIs

Example 1
public void w(Throwable t) {
        if (t == null) {
            t = new Exception("null exception logged");
        }
        println(Log.WARN, t.getMessage(), t);
    }
Example 2
public static void w(String... msg) {
        if (ADB && LOG_DEGREE <= Log.WARN) {
        	getMethodNames(new Throwable().getStackTrace());
            String msgStr = createLog(msg);
            
            Log.w(className, msgStr);
            
            writeLogToFile(Log.WARN, className, msgStr, null);
        }
    }
Example 3
public static void wTag(String tag, String msg) {
        if (enableLog(Log.WARN)) {
            sILogger.log(Log.WARN, tag, msg, null);
        }
    }
Example 4
public int w(Throwable throwable, Object s1, Object... args) {
        if( getLoggingLevel()> Log.WARN )
            return 0;

        final String s = Strings.toString(s1);
        final String message = formatArgs(s, args) + '\n' + Log.getStackTraceString(throwable);
        return println(Log.WARN, message);
    }
Example 5
public void w(Object str) {
		if (debug) {
			if (logLevel <= Log.WARN) {
				String name = getFunctionName();
				if (name != null) {
					Log.w(tag, name + "\n" + str + "\n------------------------------------------------------------------------------");
				} else {
					Log.w(tag, str.toString());
				}
			}
		}
	}
Example 6
public void onCreate() {
		super.onCreate();

		Util.log(null, Log.WARN, "UI started");
		mPrevHandler = Thread.getDefaultUncaughtExceptionHandler();
		Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
			@Override
			public void uncaughtException(Thread thread, Throwable ex) {
				Util.bug(null, ex);
				if (mPrevHandler != null)
					mPrevHandler.uncaughtException(thread, ex);
			}
		});
	}
Example 7
public void w(final String format, final Object... args) {
    if (isLoggable(Log.WARN)) {
      Log.w(tag, toMessage(format, args));
    }
  }
Example 8
public static void warning(String message) {
    if (isLoggable(Log.WARN)) {
      Log.w(LOG_TAG, formatMessage(message));
    }
  }
Example 9
public PSetting(int _uid, String _type, String _name, String _value) {
		uid = _uid;
		type = _type;
		name = _name;
		value = _value;
		if (type == null) {
			Util.log(null, Log.WARN, "PSetting null");
			Util.logStack(null, Log.WARN);
		}
	}
Example 10
public static boolean isPackageAllowed(String packageName) {
		int uid = Binder.getCallingUid();

		if (packageName == null) {
			Util.log(null, Log.WARN, "isPackageAllowed uid=" + uid + " package=" + packageName);
			Util.logStack(null, Log.WARN);
			return false;
		}

		return PrivacyManager.getSettingBool(-uid, Meta.cTypeApplication, packageName, false);
	}
Example 11
public static void w(Object obj) {
        if (Log.WARN > DEBUG_LEVEL) {
            String tag = getClassName();
            String msg = obj != null ? obj.toString() : "obj == null";
            Log.w(tag, msg);
        }
    }
Example 12
public void delete(Key key) {
        String safeKey = safeKeyGenerator.getSafeKey(key);
        try {
            getDiskCache().remove(safeKey);
        } catch (IOException e) {
            if (Log.isLoggable(TAG, Log.WARN)) {
                Log.w(TAG, "Unable to delete from disk cache", e);
            }
        }
    }
Example 13
private static String extractHost(String url) {
    try {
      URL parsed = new URL(url);
      return parsed.getHost();
    } catch (MalformedURLException e) {
      LogWrapper.log(Log.WARN, LOG_TAG, "URL is corrupted");
      return null;
    }
  }
Example 14
public static void registerMethod(String methodName, String restrictionName, String[] permissions) {
		if (restrictionName != null && !mPermissions.containsKey(restrictionName))
			Util.log(null, Log.WARN, "Missing restriction " + restrictionName);

		for (String permission : permissions)
			if (!mPermissions.get(restrictionName).contains(permission))
				Util.log(null, Log.WARN, "Missing permission " + permission);

		if (!mMethods.containsKey(restrictionName) || !mMethods.get(restrictionName).contains(methodName))
			Util.log(null, Log.WARN, "Missing method " + methodName);
	}
Example 15
public void w_shouldLogAppropriately_withThrowable() {
    Throwable throwable = new Throwable();

    Log.w("tag", "msg", throwable);

    assertLogged(Log.WARN, "tag", "msg", throwable);
  }
Example 16
private boolean writeDataDirect(ByteBuffer data, File file) {
    try {
      ByteBufferUtil.toFile(data, file);
    } catch (IOException e) {
      if (Log.isLoggable(TAG, Log.WARN)) {
        Log.w(TAG, "Failed to write GIF data", e);
      }
      return false;
    }
    return true;
  }
Example 17
static void clearCache(Context context) {
        try {
            getCache(context).clearCache();
        } catch (IOException e) {
            Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, "clearCache failed " + e.getMessage());
        }
    }
Example 18
public static void setPermissions(String path, int mode, int uid, int gid) {
		try {
			// frameworks/base/core/java/android/os/FileUtils.java
			Class<?> fileUtils = Class.forName("android.os.FileUtils");
			Method setPermissions = fileUtils
					.getMethod("setPermissions", String.class, int.class, int.class, int.class);
			setPermissions.invoke(null, path, mode, uid, gid);
			Util.log(null, Log.WARN, "Changed permission path=" + path + " mode=" + Integer.toOctalString(mode)
					+ " uid=" + uid + " gid=" + gid);
		} catch (Throwable ex) {
			Util.bug(null, ex);
		}
	}
Example 19
public void logw(String message) {
        if (LOGTAG == null)
            return;
        if (logLevel > Log.WARN)
            return;
        Log.w(LOGTAG, getLogMessage(message));
    }
Example 20
public static void manage(Context context, int uid, String action) {
		if (uid == 0)
			manage(context, null, action);
		else {
			String[] packageName = context.getPackageManager().getPackagesForUid(uid);
			if (packageName != null && packageName.length > 0)
				manage(context, packageName[0], action);
			else
				Util.log(null, Log.WARN, "No packages uid=" + uid + " action=" + action);
		}
	}
Example 21
private void onAutopilotError(int logLevel, CharSequence errorMsg) {
        if (TextUtils.isEmpty(errorMsg))
            return;

        switch (logLevel) {
            case Log.ERROR:
            case Log.WARN:
                handler.removeCallbacks(hideWarningViewCb);

                warningText.setText(errorMsg);
                warningContainer.setVisibility(View.VISIBLE);
                handler.postDelayed(hideWarningViewCb, WARNING_VIEW_DISPLAY_TIMEOUT);
                break;
        }
    }
Example 22
public static boolean hasMarketLink(Context context, String packageName) {
		try {
			PackageManager pm = context.getPackageManager();
			String installer = pm.getInstallerPackageName(packageName);
			if (installer != null)
				return installer.equals("com.android.vending") || installer.contains("google");
		} catch (Exception ex) {
			log(null, Log.WARN, ex.toString());
		}
		return false;
	}
Example 23
public static void w(String message) {
        if (!DEVELOP_MODE || TextUtils.isEmpty(message)) {
            return;
        }
        final StackTraceElement[] stack = new Throwable().getStackTrace();
        final int i = 1;
        final StackTraceElement ste = stack[i];
        Log.println(Log.WARN, LOG_TAG, String.format("[%s][%s][%s]%s", ste.getFileName(), ste.getMethodName(), ste.getLineNumber(), message));
    }
Example 24
private int readInt(XmlPullParser parser, String ns, String name, int defValue) {
        String v = parser.getAttributeValue(ns, name);
        try {
            if (v == null) {
                return defValue;
            }
            return Integer.parseInt(v);
        } catch (NumberFormatException e) {
            PackageManagerService.reportSettingsProblem(Log.WARN,
                    "Error in package manager settings: attribute " + name
                            + " has bad integer value " + v + " at "
                            + parser.getPositionDescription());
        }
        return defValue;
    }
Example 25
static InputStream getCachedImageStream(Uri uri, Context context) {
        InputStream imageStream = null;
        if (uri != null) {
            if (isCDNURL(uri)) {
                try {
                    FileLruCache cache = getCache(context);
                    imageStream = cache.get(uri.toString());
                } catch (IOException e) {
                    Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, e.toString());
                }
            }
        }

        return imageStream;
    }