Java Code Examples for android.util.Log#VERBOSE

The following examples show how to use android.util.Log#VERBOSE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BitgattDebugTree.java    From bitgatt with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void log(int priority, @Nullable String tag, @NotNull String message, @Nullable Throwable t) {
    // Workaround for devices that doesn't show lower priority logs
    if(Build.MANUFACTURER == null) {
        return;
    }
    if (Build.MANUFACTURER.equals("HUAWEI") || Build.MANUFACTURER.equals("samsung")) {
        if (priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO)
            priority = Log.ERROR;
    }
    if (priority >= Log.WARN) {
        if(message.length() < MAX_LOG_LENGTH) {
            super.log(priority, tag, message, t);
            return;
        }
        splitLogMessage(priority, tag, message, t);
    } else {
        if(message.length() < MAX_LOG_LENGTH) {
            super.log(priority, tag, message, t);
            return;
        }
        splitLogMessage(priority, tag, message, t);
    }
}
 
Example 2
Source File: LogcatDumper.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 6 votes vote down vote up
private int getLevel(@NonNull String log) {
    if(log.length() < 20){
        return 'V';
    }
    char level = log.charAt(19);
    switch (level) {
        case 'V':
            return Log.VERBOSE;
        case 'I':
            return Log.INFO;
        case 'D':
            return Log.DEBUG;
        case 'W':
            return Log.WARN;
        case 'E':
            return Log.ERROR;
    }
    return 0;
}
 
Example 3
Source File: MyApplication.java    From AndroidBlueprints with Apache License 2.0 6 votes vote down vote up
@Override
protected void log(int priority, String tag, String message, Throwable throwable) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG) {
        return;
    }

    FakeCrashLibrary.log(priority, tag, message);

    if (throwable != null) {
        if (priority == Log.ERROR) {
            FakeCrashLibrary.logError(throwable);
        } else if (priority == Log.WARN) {
            FakeCrashLibrary.logWarning(throwable);
        }
    }
}
 
Example 4
Source File: CrashlyticsTree.java    From Pharmacy-Android with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void log(int priority, @Nullable String tag, @Nullable String message, @Nullable Throwable t) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO) {
        return;
    }

    Crashlytics.setInt(CRASHLYTICS_KEY_PRIORITY, priority);
    Crashlytics.setString(CRASHLYTICS_KEY_TAG, tag);
    Crashlytics.setString(CRASHLYTICS_KEY_MESSAGE, message);

    if (t == null) {
        Crashlytics.logException(new Exception(message));
    } else {
        Crashlytics.logException(t);
    }
}
 
Example 5
Source File: LogLine.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
private static int convertCharToLogLevel(char logLevelChar) {

        switch (logLevelChar) {
            case 'D':
                return Log.DEBUG;
            case 'E':
                return Log.ERROR;
            case 'I':
                return Log.INFO;
            case 'V':
                return Log.VERBOSE;
            case 'W':
                return Log.WARN;
            case 'F':
                return LogLineAdapterUtil.LOG_WTF; // 'F' actually stands for 'WTF', which is a real Android log level in 2.2
        }
        return -1;
    }
 
Example 6
Source File: RobolectricTestWithConfig.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
private static String logTypeToString(int type) {
    switch (type) {
        case Log.ASSERT:
            return "Assert";
        case Log.DEBUG:
            return "Debug";
        case Log.ERROR:
            return "Error";
        case Log.WARN:
            return "Warn";
        case Log.INFO:
            return "Info";
        case Log.VERBOSE:
            return "Verbose";
        default:
            return "?";
    }
}
 
Example 7
Source File: JUnitTree.java    From RxShell with Apache License 2.0 6 votes vote down vote up
private static String priorityToString(int priority) {
    switch (priority) {
        case Log.ERROR:
            return "E";
        case Log.WARN:
            return "W";
        case Log.INFO:
            return "I";
        case Log.DEBUG:
            return "D";
        case Log.VERBOSE:
            return "V";
        default:
            return String.valueOf(priority);
    }
}
 
Example 8
Source File: LogInfoDokitView.java    From DoraemonKit with Apache License 2.0 6 votes vote down vote up
private int getSelectLogLevel() {
    int checkedId = mRadioGroup.getCheckedRadioButtonId();
    if (checkedId == R.id.verbose) {
        return Log.VERBOSE;
    } else if (checkedId == R.id.debug) {
        return Log.DEBUG;
    } else if (checkedId == R.id.info) {
        return Log.INFO;
    } else if (checkedId == R.id.warn) {
        return Log.WARN;
    } else if (checkedId == R.id.error) {
        return Log.ERROR;
    } else {
        return Log.VERBOSE;
    }
}
 
Example 9
Source File: LogView.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 6 votes vote down vote up
void bind(LogcatDumper.LogInfo log) {
    mCurLog = log;
    switch (log.level) {
        case Log.VERBOSE:
            mText.setTextColor(Color.parseColor("#FFFFFF"));
            break;
        case Log.INFO:
            mText.setTextColor(Color.parseColor("#2196F3"));

            break;
        case Log.DEBUG:
            mText.setTextColor(Color.parseColor("#4CAF50"));

            break;
        case Log.WARN:
            mText.setTextColor(Color.parseColor("#FFEB3B"));
            break;
        case Log.ERROR:
            mText.setTextColor(Color.parseColor("#F44336"));
            break;
        default:
            mText.setTextColor(Color.parseColor("#FFFFFF"));

    }
    mText.setText(log.message);
}
 
Example 10
Source File: McuMgrBleTransport.java    From mcumgr-android with Apache License 2.0 6 votes vote down vote up
@Override
public void log(int priority, @NonNull String message) {
    if (mLoggingEnabled) {
        switch (priority) {
            case Log.DEBUG:
                LOG.debug(message);
                break;
            case Log.INFO:
                LOG.info(message);
                break;
            case Log.WARN:
                LOG.warn(message);
                break;
            case Log.ERROR:
            case Log.ASSERT:
                LOG.error(message);
                break;
            case Log.VERBOSE:
            default:
                LOG.trace(message);
                break;
        }
    }
}
 
Example 11
Source File: JUnitTree.java    From RxShell with Apache License 2.0 6 votes vote down vote up
private static String priorityToString(int priority) {
    switch (priority) {
        case Log.ERROR:
            return "E";
        case Log.WARN:
            return "W";
        case Log.INFO:
            return "I";
        case Log.DEBUG:
            return "D";
        case Log.VERBOSE:
            return "V";
        default:
            return String.valueOf(priority);
    }
}
 
Example 12
Source File: ReleaseTimberTree.java    From Learning-Resources with MIT License 5 votes vote down vote up
@Override
protected boolean isLoggable(String tag, int priority) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO) {
        return false;
    }

    // In Case of Release Build User can only get Log for : Log.WARN, Log.ERROR, wtf

    return true;
}
 
Example 13
Source File: LogUtil.java    From timecat with Apache License 2.0 5 votes vote down vote up
/**
 * 用于区分不同接口数据 打印传入参数
 *
 * @param index
 * @param str
 */

private static void print(int index, Object str) {
    if (!OPEN_LOG) {
        return;
    }
    if (log == null) {
        log = new LogUtil(USER_NAME);
    }
    String name = log.getFunctionName();
    if (name != null) {
        str = String.format("%s -----> %s", name, str);
    }

    // Close the debug log When DEBUG is false
    if (!DEBUG) {
        if (index <= Log.DEBUG) {
            return;
        }
    }
    switch (index) {
        case Log.VERBOSE:
            Log.v(tag, str.toString());
            break;
        case Log.DEBUG:
            Log.d(tag, str.toString());
            break;
        case Log.INFO:
            Log.i(tag, str.toString());
            break;
        case Log.WARN:
            Log.w(tag, str.toString());
            break;
        case Log.ERROR:
            Log.e(tag, str.toString());
            break;
        default:
            break;
    }
}
 
Example 14
Source File: AsyncHttpRequest.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
public void logv(String message) {
    if (LOGTAG == null)
        return;
    if (logLevel > Log.VERBOSE)
        return;
    Log.v(LOGTAG, getLogMessage(message));
}
 
Example 15
Source File: App.java    From okuki with Apache License 2.0 5 votes vote down vote up
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    if (priority == Log.VERBOSE || priority == Log.DEBUG) {
        return;
    }

    //TODO Log to crash reporting
    if (t != null) {
        if (priority == Log.ERROR) {
            //TODO Log throwable as error to crash reporting
        } else if (priority == Log.WARN) {
            //TODO Log throwable as warning to crash reporting
        }
    }
}
 
Example 16
Source File: L.java    From materialup with Apache License 2.0 4 votes vote down vote up
private static void log(final int pType, final Throwable t, final Object s1,
                        final Object... args) {
    if (pType == Log.ERROR || BuildConfig.DEBUG || Log.isLoggable("L", pType)) {
        final StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[4];

        final String fullClassName = stackTraceElement.getClassName();
        final String className = fullClassName.substring(fullClassName.lastIndexOf(".") + 1);
        final int lineNumber = stackTraceElement.getLineNumber();
        final String method = stackTraceElement.getMethodName();

        final String tag = className + ":" + lineNumber;

        final StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(method);
        stringBuilder.append("(): ");

        if (s1 != null) {
            final String message = (args == null) ? s1.toString()
                    : String.format((String) s1, args);
            stringBuilder.append(message);
        }

        switch (pType) {
            case Log.VERBOSE:
                if (t != null) {
                    Log.v(tag, stringBuilder.toString(), t);
                } else {
                    Log.v(tag, stringBuilder.toString());
                }
                break;

            case Log.DEBUG:
                if (t != null) {
                    Log.d(tag, stringBuilder.toString(), t);
                } else {
                    Log.d(tag, stringBuilder.toString());
                }
                break;

            case Log.INFO:
                if (t != null) {
                    Log.i(tag, stringBuilder.toString(), t);
                } else {
                    Log.i(tag, stringBuilder.toString());
                }
                break;

            case Log.WARN:
                if (t != null) {
                    Log.w(tag, stringBuilder.toString(), t);
                } else {
                    Log.w(tag, stringBuilder.toString());
                }
                break;

            case Log.ERROR:
                if (t != null) {
                    Log.e(tag, stringBuilder.toString(), t);
                } else {
                    Log.e(tag, stringBuilder.toString());
                }
                break;
        }
    }
}
 
Example 17
Source File: LoggingListener.java    From StatusStories with Apache License 2.0 4 votes vote down vote up
public LoggingListener(@NonNull String name) {
    this(Log.VERBOSE, name);
}
 
Example 18
Source File: LogUtil.java    From NewbieGuide with Apache License 2.0 4 votes vote down vote up
public static void v(String msg, Throwable tr) {
    if (level <= Log.VERBOSE) {
        String tag = generateTag();
        Log.v(tag, msg, tr);
    }
}
 
Example 19
Source File: VLog.java    From Phantom with Apache License 2.0 4 votes vote down vote up
public static void v(String format, Object... args) {
    if (Log.VERBOSE >= sLevel) {
        Log.v(sTag, buildMsg(String.format(format, args)));
    }
}
 
Example 20
Source File: L.java    From droidddle with Apache License 2.0 4 votes vote down vote up
private static void log(final int pType, final Throwable t, final Object s1, final Object... args) {
    if (pType == Log.ERROR || BuildConfig.DEBUG) {
        final StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[4];

        final String fullClassName = stackTraceElement.getClassName();
        final String className = fullClassName.substring(fullClassName.lastIndexOf(".") + 1);
        final int lineNumber = stackTraceElement.getLineNumber();
        final String method = stackTraceElement.getMethodName();

        final String tag = className + ":" + lineNumber;

        final StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(method);
        stringBuilder.append("(): ");

        if (s1 != null) {
            final String message = (args == null) ? s1.toString() : String.format((String) s1, args);
            stringBuilder.append(message);
        }

        switch (pType) {
            case Log.VERBOSE:
                if (t != null) {
                    Log.v(tag, stringBuilder.toString(), t);
                } else {
                    Log.v(tag, stringBuilder.toString());
                }
                break;

            case Log.DEBUG:
                if (t != null) {
                    Log.d(tag, stringBuilder.toString(), t);
                } else {
                    Log.d(tag, stringBuilder.toString());
                }
                break;

            case Log.INFO:
                if (t != null) {
                    Log.i(tag, stringBuilder.toString(), t);
                } else {
                    Log.i(tag, stringBuilder.toString());
                }
                break;

            case Log.WARN:
                if (t != null) {
                    Log.w(tag, stringBuilder.toString(), t);
                } else {
                    Log.w(tag, stringBuilder.toString());
                }
                break;

            case Log.ERROR:
                if (t != null) {
                    Log.e(tag, stringBuilder.toString(), t);
                } else {
                    Log.e(tag, stringBuilder.toString());
                }
                break;
        }
    }
}