001/*
002 *  jDTAUS Core SPI
003 *  Copyright (C) 2005 Christian Schulte
004 *  <cs@schulte.it>
005 *
006 *  This library is free software; you can redistribute it and/or
007 *  modify it under the terms of the GNU Lesser General Public
008 *  License as published by the Free Software Foundation; either
009 *  version 2.1 of the License, or any later version.
010 *
011 *  This library is distributed in the hope that it will be useful,
012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 *  Lesser General Public License for more details.
015 *
016 *  You should have received a copy of the GNU Lesser General Public
017 *  License along with this library; if not, write to the Free Software
018 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
019 *
020 */
021package org.jdtaus.core.logging.spi;
022
023/**
024 * Logs events for a specific component.
025 * <p>jDTAUS Core SPI {@code Logger} specification to be used by implementations
026 * to log technical events.</p>
027 *
028 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
029 * @version $JDTAUS: Logger.java 8641 2012-09-27 06:45:17Z schulte $
030 * @see org.jdtaus.core.container.Container
031 */
032public interface Logger
033{
034    //--Logger------------------------------------------------------------------
035
036    /**
037     * Getter for property {@code debugEnabled}.
038     *
039     * @return {@code true} if logging debug messages is enabled; {@code false}
040     * if logging debug messages is disabled.
041     */
042    boolean isDebugEnabled();
043
044    /**
045     * Logs a message at log level {@code debug}.
046     *
047     * @param message the message to log.
048     */
049    void debug( String message );
050
051    /**
052     * Logs an exception at log level {@code debug}.
053     *
054     * @param t the exception to log.
055     */
056    void debug( Throwable t );
057
058    /**
059     * Getter for property {@code errorEnabled}.
060     *
061     * @return {@code true} if logging error messages is enabled; {@code false}
062     * if logging error messages is disabled.
063     */
064    boolean isErrorEnabled();
065
066    /**
067     * Logs a message at log level {@code error}.
068     *
069     * @param message the message to log.
070     */
071    void error( String message );
072
073    /**
074     * Logs an exception at log level {@code error}.
075     *
076     * @param t the exception to log.
077     */
078    void error( Throwable t );
079
080    /**
081     * Getter for property {@code fatalEnabled}.
082     *
083     * @return {@code true} if logging fatal messages is enabled; {@code false}
084     * if logging fatal messages is disabled.
085     */
086    boolean isFatalEnabled();
087
088    /**
089     * Logs a message at log level {@code fatal}.
090     *
091     * @param message the message to log.
092     */
093    void fatal( String message );
094
095    /**
096     * Logs an exception at log level {@code fatal}.
097     *
098     * @param t the exception to log.
099     */
100    void fatal( Throwable t );
101
102    /**
103     * Getter for property {@code infoEnabled}.
104     *
105     * @return {@code true} if logging info messages is enabled; {@code false}
106     * if logging info messages is disabled.
107     */
108    boolean isInfoEnabled();
109
110    /**
111     * Logs a message at log level {@code info}.
112     *
113     * @param message the message to log.
114     */
115    void info( String message );
116
117    /**
118     * Logs an exception at log level {@code info}.
119     *
120     * @param t the exception to log.
121     */
122    void info( Throwable t );
123
124    /**
125     * Getter for property {@code traceEnabled}.
126     *
127     * @return {@code true} if logging trace messages is enabled; {@code false}
128     * if logging trace messages is disabled.
129     */
130    boolean isTraceEnabled();
131
132    /**
133     * Logs a message at log level {@code trace}.
134     *
135     * @param message the message to log.
136     */
137    void trace( String message );
138
139    /**
140     * Logs an exception at log level {@code trace}.
141     *
142     * @param t the exception to log.
143     */
144    void trace( Throwable t );
145
146    /**
147     * Getter for property {@code warnEnabled}.
148     *
149     * @return {@code true} if logging warning messages is enabled;
150     * {@code false} if logging warning messages is disabled.
151     */
152    boolean isWarnEnabled();
153
154    /**
155     * Logs a message at log level {@code warn}.
156     *
157     * @param message the message to log.
158     */
159    void warn( String message );
160
161    /**
162     * Logs an exception at log level {@code warn}.
163     *
164     * @param t the exception to log.
165     */
166    void warn( Throwable t );
167
168    //------------------------------------------------------------------Logger--
169}