新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > Android 框架簡介

        Android 框架簡介

        作者: 時間:2016-09-12 來源:網絡 收藏

        * significant work and incurring significant overhead.

        */

        public final class Log {

        /**

        * Priority constant for the println method; use Log.v.

        */

        public static final int VERBOSE = 2;

        /**

        * Priority constant for the println method; use Log.d.

        */

        public static final int DEBUG = 3;

        /**

        * Priority constant for the println method; use Log.i.

        */

        public static final int INFO = 4;

        /**

        * Priority constant for the println method; use Log.w.

        */

        public static final int WARN = 5;

        /**

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

        */

        public static final int ERROR = 6;

        /**

        * Priority constant for the println method.

        */

        public static final int ASSERT = 7;

        /**

        * Exception class used to capture a stack trace in {@link #wtf()}.

        */

        private static class TerribleFailure extends Exception {

        TerribleFailure(String msg, Throwable cause) { super(msg, cause); }

        }

        private Log() {

        }

        /**

        * Send a {@link #VERBOSE} log message.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        */

        public static int v(String tag, String msg) {

        return println_native(LOG_ID_MAIN, VERBOSE, tag, msg);

        }

        /**

        * Send a {@link #VERBOSE} log message and log the exception.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        * @param tr An exception to log

        */

        public static int v(String tag, String msg, Throwable tr) {

        return println_native(LOG_ID_MAIN, VERBOSE, tag, msg + '/n' + getStackTraceString(tr));

        }

        /**

        * Send a {@link #DEBUG} log message.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        */

        public static int d(String tag, String msg) {

        return println_native(LOG_ID_MAIN, DEBUG, tag, msg);

        }

        /**

        * Send a {@link #DEBUG} log message and log the exception.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        * @param tr An exception to log

        */

        public static int d(String tag, String msg, Throwable tr) {

        return println_native(LOG_ID_MAIN, DEBUG, tag, msg + '/n' + getStackTraceString(tr));

        }

        /**

        * Send an {@link #INFO} log message.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        */

        public static int i(String tag, String msg) {

        return println_native(LOG_ID_MAIN, INFO, tag, msg);

        }

        /**

        * Send a {@link #INFO} log message and log the exception.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        * @param tr An exception to log

        */

        public static int i(String tag, String msg, Throwable tr) {

        return println_native(LOG_ID_MAIN, INFO, tag, msg + '/n' + getStackTraceString(tr));

        }

        /**

        * Send a {@link #WARN} log message.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        */

        public static int w(String tag, String msg) {

        return println_native(LOG_ID_MAIN, WARN, tag, msg);

        }

        /**

        * Send a {@link #WARN} log message and log the exception.

        * @param tag Used to identify the source of a log message. It usually identifies

        * the class or activity where the log call occurs.

        * @param msg The message you would like logged.

        * @param tr An exception to log

        */

        public static int w(String tag, String msg, Throwable tr) {

        return println_native(LOG_ID_MAIN, WARN, tag, msg + '/n' + getStackTraceString(tr));

        }

        /**

        * Checks to see whether or not a log for the specified tag is loggable at the specified level.

        *

        * The default level of any tag is set to INFO. This means that any level above and including



        關鍵詞: Android 框架簡介

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 平果县| 攀枝花市| 油尖旺区| 民和| 三门县| 嘉兴市| 通渭县| 海安县| 正宁县| 阳曲县| 杭州市| 龙海市| 通海县| 邛崃市| 米林县| 竹山县| 农安县| 连州市| 合川市| 拜城县| 西畴县| 黄冈市| 大石桥市| 宁河县| 类乌齐县| 成武县| 林口县| 安平县| 招远市| 南郑县| 静海县| 青州市| 吴旗县| 根河市| 许昌市| 涪陵区| 永德县| 大关县| 盐亭县| 天津市| 新晃|