⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logref.java

📁 OSGI这是一个中间件,与UPNP齐名,是用于移植到嵌入式平台之上
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     */    public boolean doInfo() {        return getLogLevel() >= LOG_INFO;    }    /**     * * Returns true if messages with severity error or higher * are saved by     * the log. *     *      * @return <code>true</code> if messages with severity LOG_ERROR * or     *         higher are included in the log, otherwise <code>false</code>.     */    public boolean doError() {        return getLogLevel() >= LOG_ERROR;    }    /**     * * Log a debug level message * *     *      * @param msg     *            Log message.     */    public void debug(String msg) {        doLog(msg, LOG_DEBUG, (ServiceReference) null, (Throwable) null);    }    /**     * * Log a debug level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with.     */    public void debug(String msg, ServiceReference sr) {        doLog(msg, LOG_DEBUG, sr, (Throwable) null);    }    /**     * * Log a debug level message. * *     *      * @param msg     *            Log message *     * @param e     *            The exception that reflects the condition.     */    public void debug(String msg, Throwable e) {        doLog(msg, LOG_DEBUG, (ServiceReference) null, e);    }    /**     * * Log a debug level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with. *     * @param e     *            The exception that reflects the condition.     */    public void debug(String msg, ServiceReference sr, Throwable e) {        doLog(msg, LOG_DEBUG, sr, e);    }    /**     * * Log an info level message. * *     *      * @param msg     *            Log message     */    public void info(String msg) {        doLog(msg, LOG_INFO, (ServiceReference) null, (Throwable) null);    }    /**     * * Log an info level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with.     */    public void info(String msg, ServiceReference sr) {        doLog(msg, LOG_INFO, sr, (Throwable) null);    }    /**     * * Log an info level message. * *     *      * @param msg     *            Log message *     * @param e     *            The exception that reflects the condition.     */    public void info(String msg, Throwable e) {        doLog(msg, LOG_INFO, (ServiceReference) null, e);    }    /**     * * Log an info level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with. *     * @param e     *            The exception that reflects the condition.     */    public void info(String msg, ServiceReference sr, Throwable e) {        doLog(msg, LOG_INFO, sr, e);    }    /**     * * Log a warning level message. * *     *      * @param msg     *            Log message     */    public void warn(String msg) {        doLog(msg, LOG_WARNING, (ServiceReference) null, (Throwable) null);    }    /**     * * Log a warning level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with.     */    public void warn(String msg, ServiceReference sr) {        doLog(msg, LOG_WARNING, sr, (Throwable) null);    }    /**     * * Log a warning level message. * *     *      * @param msg     *            Log message *     * @param e     *            The exception that reflects the condition.     */    public void warn(String msg, Throwable e) {        doLog(msg, LOG_WARNING, (ServiceReference) null, e);    }    /**     * * Log a warning level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with. *     * @param e     *            The exception that reflects the condition.     */    public void warn(String msg, ServiceReference sr, Throwable e) {        doLog(msg, LOG_WARNING, sr, e);    }    /**     * * Log an error level message. * *     *      * @param msg     *            Log message     */    public void error(String msg) {        doLog(msg, LOG_ERROR, (ServiceReference) null, (Throwable) null);    }    /**     * * Log an error level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with.     */    public void error(String msg, ServiceReference sr) {        doLog(msg, LOG_ERROR, sr, (Throwable) null);    }    /**     * * Log an error level message. * *     *      * @param msg     *            Log message *     * @param e     *            The exception that reflects the condition.     */    public void error(String msg, Throwable e) {        doLog(msg, LOG_ERROR, (ServiceReference) null, e);    }    /**     * * Log an error level message. * *     *      * @param msg     *            Log message *     * @param sr     *            The <code>ServiceReference</code> of the service * that this     *            message is associated with. *     * @param e     *            The exception that reflects the condition.     */    public void error(String msg, ServiceReference sr, Throwable e) {        doLog(msg, LOG_ERROR, sr, e);    }    /**     * * Log a message. * The ServiceDescription field and the Throwable * field     * of the LogEntry will be set to null. *     *      * @param level     *            The severity of the message. (Should be one of the * four     *            predefined severities.) *     * @param message     *            Human readable string describing the condition.     */    public void log(int level, String message) {        doLog(message, level, (ServiceReference) null, (Throwable) null);    }    /**     * * Log a message with an exception. * The ServiceDescription field of the     * LogEntry will be set to null. *     *      * @param level     *            The severity of the message. (Should be one of the * four     *            predefined severities.) *     * @param message     *            Human readable string describing the condition. *     * @param exception     *            The exception that reflects the condition.     */    public void log(int level, String message, Throwable exception) {        doLog(message, level, (ServiceReference) null, exception);    }    /**     * * Log a message associated with a specific Service. * The Throwable field     * of the LogEntry will be set to null. *     *      * @param sr     *            The <code>ServiceReference</code> of the service that * this     *            message is associated with. *     * @param level     *            The severity of the message. (Should be one of the * four     *            predefined severities.) *     * @param message     *            Human readable string describing the condition.     */    public void log(ServiceReference sr, int level, String message) {        doLog(message, level, sr, (Throwable) null);    }    /**     * * Log a message with an exception associated with a specific Service. *     *      * @param sr     *            The <code>ServiceReference</code> of the service that * this     *            message is associated with. *     * @param level     *            The severity of the message. (Should be one of the * four     *            predefined severities.) *     * @param message     *            Human readable string describing the condition. *     * @param exception     *            The exception that reflects the condition.     */    public void log(ServiceReference sr, int level, String message,            Throwable exception) {        doLog(message, level, sr, exception);    }    /**     * * Returns a human readable name for the bundle that * <code>bc</code>     * represents. *     *      * @return Name of the bundle that uses this wrapper * (at least 12     *         characters).     */    private String getBundleName() {        StringBuffer bundleName = new StringBuffer(24);        // We can't get bundle-name since it requires AdminPermission.        // bundleName.append((String)bc.getBundle().getHeaders().get("Bundle-Name"));        // If name was not found use the Bid as name.        if (bundleName.length() <= 0) {            bundleName.append("bid#");            bundleName.append(String.valueOf(bundleId));        }        if (bundleName.length() < 12) {            bundleName.append("            ");            bundleName.setLength(12);        }        return bundleName.toString();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -