亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? simplelog.java

?? Java開發最新的日志記錄工具slf4j的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright 2001-2004 The Apache Software Foundation. *  * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.logging.impl;import java.io.InputStream;import java.io.Serializable;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.security.AccessController;import java.security.PrivilegedAction;import java.text.DateFormat;import java.text.SimpleDateFormat;import java.util.Date;import java.util.Properties;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogConfigurationException;/** * <p>Simple implementation of Log that sends all enabled log messages, * for all defined loggers, to System.err.  The following system properties * are supported to configure the behavior of this logger:</p> * <ul> * <li><code>org.apache.commons.logging.simplelog.defaultlog</code> - *     Default logging detail level for all instances of SimpleLog. *     Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). *     If not specified, defaults to "info". </li> * <li><code>org.apache.commons.logging.simplelog.log.xxxxx</code> - *     Logging detail level for a SimpleLog instance named "xxxxx". *     Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). *     If not specified, the default logging detail level is used.</li> * <li><code>org.apache.commons.logging.simplelog.showlogname</code> - *     Set to <code>true</code> if you want the Log instance name to be *     included in output messages. Defaults to <code>false</code>.</li> * <li><code>org.apache.commons.logging.simplelog.showShortLogname</code> - *     Set to <code>true</code> if you want the last component of the name to be *     included in output messages. Defaults to <code>true</code>.</li> * <li><code>org.apache.commons.logging.simplelog.showdatetime</code> - *     Set to <code>true</code> if you want the current date and time *     to be included in output messages. Default is <code>false</code>.</li> * <li><code>org.apache.commons.logging.simplelog.dateTimeFormat</code> - *     The date and time format to be used in the output messages. *     The pattern describing the date and time format is the same that is *     used in <code>java.text.SimpleDateFormat</code>. If the format is not *     specified or is invalid, the default format is used. *     The default format is <code>yyyy/MM/dd HH:mm:ss:SSS zzz</code>.</li> * </ul> * * <p>In addition to looking for system properties with the names specified * above, this implementation also checks for a class loader resource named * <code>"simplelog.properties"</code>, and includes any matching definitions * from this resource (if it exists).</p> * * @author <a href="mailto:sanders@apache.org">Scott Sanders</a> * @author Rod Waldhoff * @author Robert Burrell Donkin * * @version $Id: SimpleLog.java,v 1.21 2004/06/06 20:47:56 rdonkin Exp $ */public class SimpleLog implements Log, Serializable {    // ------------------------------------------------------- Class Attributes    /** All system properties used by <code>SimpleLog</code> start with this */    static protected final String systemPrefix =        "org.apache.commons.logging.simplelog.";    /** Properties loaded from simplelog.properties */    static protected final Properties simpleLogProps = new Properties();    /** The default format to use when formating dates */    static protected final String DEFAULT_DATE_TIME_FORMAT =        "yyyy/MM/dd HH:mm:ss:SSS zzz";    /** Include the instance name in the log message? */    static protected boolean showLogName = false;    /** Include the short name ( last component ) of the logger in the log     *  message. Defaults to true - otherwise we'll be lost in a flood of     *  messages without knowing who sends them.     */    static protected boolean showShortName = true;    /** Include the current time in the log message */    static protected boolean showDateTime = false;    /** The date and time format to use in the log message */    static protected String dateTimeFormat = DEFAULT_DATE_TIME_FORMAT;    /** Used to format times */    static protected DateFormat dateFormatter = null;    // ---------------------------------------------------- Log Level Constants    /** "Trace" level logging. */    public static final int LOG_LEVEL_TRACE  = 1;    /** "Debug" level logging. */    public static final int LOG_LEVEL_DEBUG  = 2;    /** "Info" level logging. */    public static final int LOG_LEVEL_INFO   = 3;    /** "Warn" level logging. */    public static final int LOG_LEVEL_WARN   = 4;    /** "Error" level logging. */    public static final int LOG_LEVEL_ERROR  = 5;    /** "Fatal" level logging. */    public static final int LOG_LEVEL_FATAL  = 6;    /** Enable all logging levels */    public static final int LOG_LEVEL_ALL    = (LOG_LEVEL_TRACE - 1);    /** Enable no logging levels */    public static final int LOG_LEVEL_OFF    = (LOG_LEVEL_FATAL + 1);    // ------------------------------------------------------------ Initializer    private static String getStringProperty(String name) {        String prop = null;	try {	    prop = System.getProperty(name);	} catch (SecurityException e) {	    ; // Ignore	}        return (prop == null) ? simpleLogProps.getProperty(name) : prop;    }    private static String getStringProperty(String name, String dephault) {        String prop = getStringProperty(name);        return (prop == null) ? dephault : prop;    }    private static boolean getBooleanProperty(String name, boolean dephault) {        String prop = getStringProperty(name);        return (prop == null) ? dephault : "true".equalsIgnoreCase(prop);    }    // Initialize class attributes.    // Load properties file, if found.    // Override with system properties.    static {        // Add props from the resource simplelog.properties        InputStream in = getResourceAsStream("simplelog.properties");        if(null != in) {            try {                simpleLogProps.load(in);                in.close();            } catch(java.io.IOException e) {                // ignored            }        }        showLogName = getBooleanProperty( systemPrefix + "showlogname", showLogName);        showShortName = getBooleanProperty( systemPrefix + "showShortLogname", showShortName);        showDateTime = getBooleanProperty( systemPrefix + "showdatetime", showDateTime);        if(showDateTime) {            dateTimeFormat = getStringProperty(systemPrefix + "dateTimeFormat",                                               dateTimeFormat);            try {                dateFormatter = new SimpleDateFormat(dateTimeFormat);            } catch(IllegalArgumentException e) {                // If the format pattern is invalid - use the default format                dateTimeFormat = DEFAULT_DATE_TIME_FORMAT;                dateFormatter = new SimpleDateFormat(dateTimeFormat);            }        }    }    // ------------------------------------------------------------- Attributes    /** The name of this simple log instance */    protected String logName = null;    /** The current log level */    protected int currentLogLevel;    /** The short name of this simple log instance */    private String shortLogName = null;    // ------------------------------------------------------------ Constructor    /**     * Construct a simple log with given name.     *     * @param name log name     */    public SimpleLog(String name) {        logName = name;        // Set initial log level        // Used to be: set default log level to ERROR        // IMHO it should be lower, but at least info ( costin ).        setLevel(SimpleLog.LOG_LEVEL_INFO);        // Set log level from properties        String lvl = getStringProperty(systemPrefix + "log." + logName);        int i = String.valueOf(name).lastIndexOf(".");        while(null == lvl && i > -1) {            name = name.substring(0,i);            lvl = getStringProperty(systemPrefix + "log." + name);            i = String.valueOf(name).lastIndexOf(".");        }        if(null == lvl) {            lvl =  getStringProperty(systemPrefix + "defaultlog");        }        if("all".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_ALL);        } else if("trace".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_TRACE);        } else if("debug".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_DEBUG);        } else if("info".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_INFO);        } else if("warn".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_WARN);        } else if("error".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_ERROR);        } else if("fatal".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_FATAL);        } else if("off".equalsIgnoreCase(lvl)) {            setLevel(SimpleLog.LOG_LEVEL_OFF);        }    }    // -------------------------------------------------------- Properties    /**     * <p> Set logging level. </p>     *     * @param currentLogLevel new logging level     */    public void setLevel(int currentLogLevel) {        this.currentLogLevel = currentLogLevel;    }    /**     * <p> Get logging level. </p>     */    public int getLevel() {        return currentLogLevel;    }    // -------------------------------------------------------- Logging Methods    /**     * <p> Do the actual logging.     * This method assembles the message     * and then calls <code>write()</code> to cause it to be written.</p>     *     * @param type One of the LOG_LEVEL_XXX constants defining the log level     * @param message The message itself (typically a String)     * @param t The exception whose stack trace should be logged     */    protected void log(int type, Object message, Throwable t) {        // Use a string buffer for better performance        StringBuffer buf = new StringBuffer();        // Append date-time if so configured        if(showDateTime) {            buf.append(dateFormatter.format(new Date()));            buf.append(" ");        }        // Append a readable representation of the log level        switch(type) {            case SimpleLog.LOG_LEVEL_TRACE: buf.append("[TRACE] "); break;            case SimpleLog.LOG_LEVEL_DEBUG: buf.append("[DEBUG] "); break;            case SimpleLog.LOG_LEVEL_INFO:  buf.append("[INFO] ");  break;            case SimpleLog.LOG_LEVEL_WARN:  buf.append("[WARN] ");  break;            case SimpleLog.LOG_LEVEL_ERROR: buf.append("[ERROR] "); break;            case SimpleLog.LOG_LEVEL_FATAL: buf.append("[FATAL] "); break;        }        // Append the name of the log instance if so configured 	if( showShortName) {            if( shortLogName==null ) {                // Cut all but the last component of the name for both styles                shortLogName = logName.substring(logName.lastIndexOf(".") + 1);                shortLogName =                    shortLogName.substring(shortLogName.lastIndexOf("/") + 1);            }            buf.append(String.valueOf(shortLogName)).append(" - ");        } else if(showLogName) {            buf.append(String.valueOf(logName)).append(" - ");        }        // Append the message        buf.append(String.valueOf(message));        // Append stack trace if not null        if(t != null) {            buf.append(" <");            buf.append(t.toString());            buf.append(">");            java.io.StringWriter sw= new java.io.StringWriter(1024);            java.io.PrintWriter pw= new java.io.PrintWriter(sw);            t.printStackTrace(pw);            pw.close();            buf.append(sw.toString());        }        // Print to the appropriate destination        write(buf);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
毛片av中文字幕一区二区| 欧美大胆一级视频| 中文字幕在线不卡一区二区三区| 极品瑜伽女神91| 日韩欧美二区三区| 日本特黄久久久高潮| 欧美肥大bbwbbw高潮| 亚洲午夜电影在线观看| 在线一区二区视频| 亚洲综合男人的天堂| 在线观看亚洲a| 亚洲在线观看免费视频| 欧美在线观看一二区| 亚洲综合色丁香婷婷六月图片| 欧美影视一区二区三区| 亚洲精品久久嫩草网站秘色| 91国在线观看| 亚洲不卡av一区二区三区| 欧美日韩和欧美的一区二区| 首页国产欧美久久| 欧美一区二区三区人| 青娱乐精品视频在线| 精品国产一区二区三区忘忧草| 国内精品免费**视频| 久久精品欧美日韩精品| 高清国产一区二区| 日韩理论片网站| 欧美自拍丝袜亚洲| 三级欧美在线一区| 精品日韩一区二区三区免费视频| 国产麻豆视频一区| 国产精品免费视频网站| 色综合激情五月| 亚洲自拍偷拍九九九| 欧美精品日日鲁夜夜添| 久草这里只有精品视频| 国产日韩精品一区二区三区在线| 成人教育av在线| 伊人婷婷欧美激情| 制服丝袜激情欧洲亚洲| 国产一区二三区好的| 国产精品久久久久aaaa樱花| 欧美在线一二三| 久久精品99国产精品| 中文字幕免费观看一区| 91福利区一区二区三区| 美女一区二区在线观看| 久久99在线观看| 日本一区二区三区dvd视频在线| 一本到不卡免费一区二区| 日本不卡中文字幕| 亚洲国产精品国自产拍av| 在线看国产一区| 久99久精品视频免费观看| 中文字幕在线一区免费| 欧美日韩中文一区| 国内久久精品视频| 一区二区三区影院| 日韩一区二区免费在线电影| 成人天堂资源www在线| 亚洲成人一区二区| 久久久精品国产免费观看同学| 色欧美日韩亚洲| 久久激情综合网| 亚洲精品国产一区二区精华液| 欧美一区二区三区视频| jlzzjlzz亚洲日本少妇| 肉肉av福利一精品导航| 国产精品美女久久久久久久| 51精品视频一区二区三区| 成人久久18免费网站麻豆| 天堂成人免费av电影一区| 亚洲国产精品黑人久久久| 欧美精品黑人性xxxx| 成人av网站在线观看免费| 免费看欧美女人艹b| 中文字幕制服丝袜成人av| 欧美一级艳片视频免费观看| 99久久免费视频.com| 久久草av在线| 亚洲国产精品久久人人爱蜜臀| 久久精品视频在线看| 欧美精品在线观看一区二区| 99久久er热在这里只有精品15 | 久久亚洲一级片| 欧美在线观看视频在线| 成人午夜激情在线| 蜜臀久久99精品久久久久宅男| 亚洲三级理论片| 久久精品欧美日韩| 欧美一级精品在线| 欧美色视频在线观看| 成人精品视频.| 精品在线亚洲视频| 天天操天天色综合| 尤物在线观看一区| 国产真实精品久久二三区| 午夜私人影院久久久久| 亚洲色图色小说| 国产欧美日韩在线看| 日韩精品中文字幕一区二区三区| 在线看一区二区| 91视视频在线观看入口直接观看www| 国产一区二区三区在线观看免费| 青青草一区二区三区| 亚洲成人免费视| 一区二区三区免费网站| 国产精品久久久久影视| 久久久蜜臀国产一区二区| 日韩一本二本av| 欧美精品xxxxbbbb| 欧美性受xxxx| 日本高清无吗v一区| 91在线国产观看| 成人激情小说乱人伦| 国产成人日日夜夜| 国产精品一品二品| 国产美女在线观看一区| 久久精品国产亚洲5555| 麻豆一区二区三| 美女网站在线免费欧美精品| 日韩精品午夜视频| 视频一区欧美精品| 午夜久久电影网| 亚洲超碰97人人做人人爱| 亚洲成人资源在线| 亚洲成人av一区二区三区| 亚洲国产aⅴ天堂久久| 亚洲国产cao| 婷婷亚洲久悠悠色悠在线播放| 午夜伦理一区二区| 日韩精品久久理论片| 日韩av电影免费观看高清完整版在线观看| 性做久久久久久| 爽好多水快深点欧美视频| 日韩电影在线观看电影| 日韩成人免费电影| 蜜臀久久久99精品久久久久久| 麻豆国产精品视频| 精品一区二区综合| 国产乱码精品一区二区三区忘忧草| 国产一区二区三区不卡在线观看| 国产麻豆成人精品| 国产盗摄精品一区二区三区在线| 成人性视频免费网站| 成人免费看视频| 91原创在线视频| 在线亚洲一区观看| 欧美日韩一区二区三区免费看| 欧美狂野另类xxxxoooo| 欧美一区二区三区白人| 日韩免费高清电影| 国产色产综合色产在线视频| 国产精品久久久久久户外露出| 亚洲靠逼com| 五月婷婷综合网| 老汉av免费一区二区三区| 国产剧情一区在线| 91影视在线播放| 欧美三级电影在线观看| 日韩一区二区影院| 欧美国产欧美亚州国产日韩mv天天看完整| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 成人免费看视频| 色视频成人在线观看免| 91麻豆精品国产91久久久| 精品理论电影在线观看 | 国产精品久久久久久福利一牛影视| 亚洲免费观看高清在线观看| 天堂成人国产精品一区| 国产一区二区调教| 一本久久综合亚洲鲁鲁五月天| 777午夜精品免费视频| 精品国产乱码久久久久久1区2区 | 久久精品人人爽人人爽| 亚洲欧洲综合另类在线| 奇米影视在线99精品| 国产成人av自拍| 欧美中文一区二区三区| 日韩三级.com| 日韩一区在线免费观看| 日韩电影在线观看一区| 国产69精品一区二区亚洲孕妇| 在线观看日韩国产| 精品福利在线导航| 亚洲欧洲综合另类| 久久99国产精品免费| 91视频你懂的| 欧美变态口味重另类| 亚洲激情图片小说视频| 美国精品在线观看| 色吧成人激情小说| 欧美精品一区二区在线观看| 亚洲黄一区二区三区| 国产尤物一区二区在线| 色菇凉天天综合网| 久久人人爽人人爽| 午夜欧美视频在线观看| 成人午夜电影网站| 欧美一二三在线|