APISonar


android.util.Log.println

> android > util > Log > println
android APIs util APIs Log APIs println APIs

Example 1
private void println(int priority, String message, Throwable t) {
        if (message == null) {
            message = "";
        }

        if (t != null) {
            message += '\n' + Log.getStackTraceString(t);
        }
        Log.println(priority, mTag, message);
    }
Example 2
private static void log(int messageLogLevel, String tag, String message, Throwable tr) {
        if (messageLogLevel >= logLevel) {
            if (tr == null) {
                Log.println(logLevel, tag, message);
            } else {
                Log.println(logLevel, tag, message + '\n' + Log.getStackTraceString(tr));
            }
        }
    }
Example 3
public void publish(Logger source, String tag, Level level, String message) {
        // TODO: avoid ducking into native 2x; we aren't saving any formatter calls
        int priority = getAndroidLevel(level);
        if (!Log.isLoggable(tag, priority)) {
            return;
        }

        try {
            Log.println(priority, tag, message);
        } catch (RuntimeException e) {
            Log.e("AndroidHandler", "Error logging message.", e);
        }
    }
Example 4
protected void log(int priority, String tag, String message, Throwable t) {
        synchronized (this) {
            Log.println(priority, tag, message);
            // Append a log to the pool.
            if (mThread == null) {
                mThread = new T();
                mThread.start();
            }
            String log = mFormat.format(Calendar.getInstance().getTime())
                    + "/" + priority
                    + "/" + tag
                    + ": " + message + "\n";
            mThread.requestWrite(priority, log);
        }
    }
Example 5
private void log(int lvl, String tag, String msg) {
        if (isLogEnable) {
            Log.println(lvl, tag, msg);
        }
    }
Example 6
public Logger log(String message) {
    if (BuildConfig.DEBUG) {
      Log.println(priority, TAG, message);
    }
    return this;
  }
Example 7
private static int println(int level, String tag, String msg) {
    if (LOG_LEVEL <= level) {
      return Log.println(level, tag, TextUtils.isEmpty(msg) ? "null" : msg);
    } else {
      return -1;
    }
  }
Example 8
public void publish(LogRecord record) {
		if (!isLoggable(record)) return;

		final int priority = getAndroidPriority(record.getLevel());
		final String tag = substringAfterLastDot(record.getSourceClassName());
		final String msg = getFormatter().format(record);

		Log.println(priority, tag, msg);
	}
Example 9
private static void printSubMsg(final int type, final String tag, final String msg) {
        if (!CONFIG.mLogBorderSwitch) {
            Log.println(type, tag, msg);
            return;
        }
        StringBuilder sb = new StringBuilder();
        String[] lines = msg.split(LINE_SEP);
        for (String line : lines) {
            Log.println(type, tag, LEFT_BORDER + line);
        }
    }
Example 10
public void log(Level level, String msg, Throwable th) {
        if (level != Level.OFF) {
            // That's how Log does it internally
            Log.println(mapLevel(level), tag, msg + "\n" + Log.getStackTraceString(th));
        }
    }
Example 11
private static void log(int priority, Object o, Throwable throwable, String message,
                            Object... args) {
        final boolean force = priority >= Log.WARN;
        if (!force && !NEED_LOG) {
            return;
        }

        Log.println(priority, getTag(o), FileDownloadUtils.formatString(message, args));
        if (throwable != null) {
            throwable.printStackTrace();
        }
    }
Example 12
public static void log(int i, String s, String s1) {
    if (BuildConfig.DEBUG) {
      Log.println(i, s, s1);
      return;
    }
    try {
      Crashlytics.log(i, s, s1);
    } catch (IllegalStateException e) {
      // This only occurs during unit tests.
    }
  }
Example 13
public void withCause(Exception cause) {
    if (BuildConfig.DEBUG) {
      Log.println(priority, TAG, Log.getStackTraceString(cause));
    }
  }
Example 14
public static void e(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.ERROR, LOG_TAG, String.format("[%s][%s][%s]%s", ste.getFileName(), ste.getMethodName(), ste.getLineNumber(), message));
    }
Example 15
public void log(final int priority, @NonNull final String message) {
		Logger.log(mLogSession, LogContract.Log.Level.fromPriority(priority), message);
		Log.println(priority, "BleManager", message);
	}
Example 16
private synchronized void showMessage(String msg, int logLevel, boolean showToast) {
        Log.println(logLevel, TAG, msg);
        if (mUserActivity != null) {
            mUserActivity.showMessage(msg, showToast);
        }
    }
Example 17
static void log(LogLevel logLevel, String str, String str2) {
        Object obj = null;
        if (logLevel == LogLevel.LOG_LEVEL_ERROR || (mLogConfig != null && mLogConfig.canLogToLogCat())) {
            obj = 1;
        }
        if (obj != null || mXLLogInternal != null) {
            String formatMessage = formatMessage(logLevel, str, str2);
            if (obj != null) {
                Log.println(logLevel.getValue(), str, formatMessage);
            }
            if (mXLLogInternal != null) {
                mXLLogInternal.log(logLevel, str, formatMessage);
            }
        }
    }
Example 18
private static void printBorder(final int type, final String tag, boolean isTop) {
        if (CONFIG.isLogBorderSwitch()) {
            Log.println(type, tag, isTop ? TOP_BORDER : BOTTOM_BORDER);
        }
    }
Example 19
public static void log(XHook hook, int priority, String msg) {
		// Check if logging enabled
		if (Process.myUid() > 0 && !mLogDetermined) {
			mLog = false;
			mLogDetermined = true;
			mLog = PrivacyManager.getSettingBool(null, null, 0, PrivacyManager.cSettingLog, false, false);
		}

		// Log if enabled
		if (priority != Log.DEBUG && (priority == Log.INFO ? mLog : true))
			if (hook == null)
				Log.println(priority, "XPrivacy", msg);
			else
				Log.println(priority, String.format("XPrivacy/%s", hook.getClass().getSimpleName()), msg);
	}
Example 20
public static void log(LoggingBehavior behavior, int priority, String tag, String string) {
        if (Settings.isLoggingBehaviorEnabled(behavior)) {
            string = replaceStrings(string);
            if (tag.startsWith(LOG_TAG_BASE) == false) {
                tag = LOG_TAG_BASE + tag;
            }
            Log.println(priority, tag, string);

            // Developer errors warrant special treatment by printing out a stack trace, to make both more noticeable,
            // and let the source of the problem be more easily pinpointed.
            if (behavior == LoggingBehavior.DEVELOPER_ERRORS) {
                (new Exception()).printStackTrace();
            }
        }
    }