/*
 * $Header: /home/cvs/commons/logging-1.0.3/ja/src/org/apache/commons/logging/Log.java,v 1.3 2004/04/08 12:22:29 hioki Exp $
 * $Revision: 1.3 $
 * $Date: 2004/04/08 12:22:29 $
 *
 * ====================================================================
 *
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowlegement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowlegement may appear in the software itself,
 *    if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 */


package org.apache.commons.logging;

/**
 * <p>ログ処理の API を抽象化したシンプルなログ処理のインタフェースです。
 * このインタフェースを実装したクラスには、 {@link LogFactory}
 * によって正しくインスタンス化を行えるようにするために、このログの「名前」を表す単独の
 * String を引数として持つコンストラクタがなければなりません。
 * {@primary A simple logging interface abstracting logging APIs.  In order to be
 * instantiated successfully by {@link LogFactory}, classes that implement
 * this interface must have a constructor that takes a single String
 * parameter representing the "name" of this Log.}</p>
 *
 * <p><code>Log</code> で使用される6つのログレベルは(順番に)以下のようになります。
 * {@primary The six logging levels used by <code>Log</code> are (in order):}
 * <ol>
 * <li>trace (最も軽微)</li>
 * <li>debug</li>
 * <li>info</li>
 * <li>warn</li>
 * <li>error</li>
 * <li>fatal (最も重大)</li>
 * </ol>
 * {@primary <ol>
 * <li>trace (the least serious)</li>
 * <li>debug</li>
 * <li>info</li>
 * <li>warn</li>
 * <li>error</li>
 * <li>fatal (the most serious)</li>
 * </ol>}
 * これらのログレベルと内部で使用されるログシステムの概念とのマッピングは
 * 各(ログシステム毎の)実装に依存します。
 * しかしながら各実装ではこの順序通りに動作することを保証する必要があります。
 * {@primary The mapping of these log levels to the concepts used by the underlying
 * logging system is implementation dependent.
 * The implemention should ensure, though, that this ordering behaves
 * as expected.}</p>
 *
 * <p>パフォーマンスはログ処理においてよく問題となる事柄です。
 * 適宜プロパティを調べることによって、(ログに出力する情報の生成といった)
 * 重い処理の部分を避けることができます。
 * {@annotation 文字列の生成や連結の事を指しているようです}
 * {@primary Performance is often a logging concern.
 * By examining the appropriate property,
 * a component can avoid expensive operations (producing information
 * to be logged).}</p>
 *
 * <p> 例えば、{@primary For example,}
 * <code><pre>
 *    if (log.isDebugEnabled()) {
 *        ... (theResult を作成する)何か重い処理を実施 ...
 *        log.debug(theResult);
 *    }
 * </pre></code>
 * {@primary <code><pre>
 *    if (log.isDebugEnabled()) {
 *        ... do something expensive ...
 *        log.debug(theResult);
 *    &#125;
 * </pre></code>}
 * </p>
 *
 * <p>内部で使用されるログシステムの設定は、そのシステムがどんなメカニズムをサポートしていたとしても、一般的に
 * Logging API の外部で行われます。
 * {@primary Configuration of the underlying logging system will generally be done
 * external to the Logging APIs, through whatever mechanism is supported by
 * that system.}</p>
 *
 * @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
 * @author Rod Waldhoff
 * @translator 日置 聡
 * @editor 高橋 達男
 * @status completion
 * @update 2004/04/08
 * @version $Id: Log.java,v 1.3 2004/04/08 12:22:29 hioki Exp $
 */
public interface Log {


    // ----------------------------------------------------- Logging Properties


    /**
     * <p> debug レベルのログ処理が現在有効かどうかチェックします。
     * {@primary Is debug logging currently enabled?}</p>
     *
     * <p> ログレベルが debug 以上の場合に(<code>String</code> の連結のような)
     * 重い処理を行わないようにこのメソッドを呼んで(チェックして)ください。
     * {@primary Call this method to prevent having to perform expensive operations
     * (for example, <code>String</code> concatination)
     * when the log level is more than debug. }</p>
     */
    public boolean isDebugEnabled();


    /**
     * <p> error レベルのログ処理が現在有効かどうかチェックします。
     * {@primary Is error logging currently enabled?}</p>
     *
     * <p> ログレベルが error 以上の場合に(<code>String</code> の連結のような)
     * 重い処理を行わないようにこのメソッドを呼んで(チェックして)ください。
     * {@primary Call this method to prevent having to perform expensive operations
     * (for example, <code>String</code> concatination)
     * when the log level is more than error. }</p>
     */
    public boolean isErrorEnabled();


    /**
     * <p> fatal レベルのログ処理が現在有効かどうかチェックします。
     * {@primary Is fatal logging currently enabled?}</p>
     *
     * <p> ログレベルが fatal 以上の場合に(<code>String</code> の連結のような)
     * 重い処理を行わないようにこのメソッドを呼んで(チェックして)ください。
     * {@primary Call this method to prevent having to perform expensive operations
     * (for example, <code>String</code> concatination)
     * when the log level is more than fatal. }</p>
     */
    public boolean isFatalEnabled();


    /**
     * <p> info レベルのログ処理が現在有効かどうかチェックします。
     * {@primary Is info logging currently enabled?}</p>
     *
     * <p> ログレベルが info 以上の場合に(<code>String</code> の連結のような)
     * 重い処理を行わないようにこのメソッドを呼んで(チェックして)ください。
     * {@primary Call this method to prevent having to perform expensive operations
     * (for example, <code>String</code> concatination)
     * when the log level is more than info. }</p>
     */
    public boolean isInfoEnabled();


    /**
     * <p> trace レベルのログ処理が現在有効かどうかチェックします。
     * {@primary Is trace logging currently enabled?}</p>
     *
     * <p> ログレベルが trace 以上の場合に(<code>String</code> の連結のような)
     * 重い処理を行わないようにこのメソッドを呼んで(チェックして)ください。
     * {@primary Call this method to prevent having to perform expensive operations
     * (for example, <code>String</code> concatination)
     * when the log level is more than trace. }</p>
     */
    public boolean isTraceEnabled();


    /**
     * <p> warning レベルのログ処理が現在有効かどうかチェックします。
     * {@primary Is warning logging currently enabled?}</p>
     *
     * <p> ログレベルが warning 以上の場合に(<code>String</code> の連結のような)
     * 重い処理を行わないようにこのメソッドを呼んで(チェックして)ください。
     * {@primary Call this method to prevent having to perform expensive operations
     * (for example, <code>String</code> concatination)
     * when the log level is more than warning. }</p>
     */
    public boolean isWarnEnabled();


    // -------------------------------------------------------- Logging Methods


    /**
     * <p> trace レベルでメッセージをログ出力します。
     * {@primary Log a message with trace log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     */
    public void trace(Object message);


    /**
     * <p> trace レベルでエラーをログ出力します。
     * {@primary Log an error with trace log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     * @param t この原因(となった例外)をログ出力します
     * {@primary log this cause}
     */
    public void trace(Object message, Throwable t);


    /**
     * <p> debug ログレベルでメッセージをログ出力します。
     * {@primary Log a message with debug log level. }</p>
     *
     * @param message このメッセージをログします
     * {@primary log this message}
     */
    public void debug(Object message);


    /**
     * <p> debug レベルでエラーをログ出力します。
     * {@primary Log an error with debug log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     * @param t この原因(となった例外)をログ出力します
     * {@primary log this cause}
     */
    public void debug(Object message, Throwable t);


    /**
     * <p> info レベルでメッセージをログ出力します。
     * {@primary Log a message with info log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     */
    public void info(Object message);


    /**
     * <p> info レベルでエラーをログ出力します。
     * {@primary Log an error with info log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     * @param t この原因(となった例外)をログ出力します
     * {@primary log this cause}
     */
    public void info(Object message, Throwable t);


    /**
     * <p> warn レベルでメッセージをログ出力します。
     * {@primary Log a message with warn log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     */
    public void warn(Object message);


    /**
     * <p> warn レベルでエラーをログ出力します。
     * {@primary Log an error with warn log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     * @param t この原因(となった例外)をログ出力します
     * {@primary log this cause}
     */
    public void warn(Object message, Throwable t);


    /**
     * <p> error レベルでメッセージをログ出力します。
     * {@primary Log a message with error log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     */
    public void error(Object message);


    /**
     * <p> error レベルでエラーをログ出力します。
     * {@primary Log an error with error log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     * @param t この原因(となった例外)をログ出力します
     * {@primary log this cause}
     */
    public void error(Object message, Throwable t);


    /**
     * <p> fatal レベルでメッセージをログ出力します。
     * {@primary Log a message with fatal log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     */
    public void fatal(Object message);


    /**
     * <p> fatal レベルでエラーをログ出力します。
     * {@primary Log an error with fatal log level. }</p>
     *
     * @param message このメッセージをログ出力します
     * {@primary log this message}
     * @param t この原因(となった例外)をログ出力します
     * {@primary log this cause}
     */
    public void fatal(Object message, Throwable t);


}
