001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.commons.io.log;
020
021/**
022 * Log Interface
023 */
024public interface Log {
025
026    /**
027     * Field <code>LEVEL_INFO</code>
028     */
029    public static final int LEVEL_INFO=0;
030    /**
031     * Field <code>LEVEL_DEBUG</code>
032     */
033    public static final int LEVEL_DEBUG=1;
034    /**
035     * Field <code>LEVEL_WARN</code>
036     */
037    public static final int LEVEL_WARN=2;
038    /**
039     * Field <code>LEVEL_ERROR</code>
040     */
041    public static final int LEVEL_ERROR=3;
042    /**
043     * Field <code>LEVEL_FATAL</code>
044     */
045    public static final int LEVEL_FATAL=4;
046
047    /**
048     * log one line
049     * @param level level to log (Log.LEVEL_DEBUG, Log.LEVEL_WARN, Log.LEVEL_ERROR)
050     * @param application application name
051     * @param message message to log
052     */
053    public void log(int level, String application, String message);
054
055    // FUTURE public void log(int level, String application, String message,Throwable t);
056    // FUTURE public void log(int level, String application,Throwable t);
057    
058    /**
059     * log level info
060     * @param application application name
061     * @param message message to log
062     */
063    public void info(String application, String message);
064
065    /**
066     * log level debug
067     * @param application application name
068     * @param message message to log
069     */
070    public void debug(String application, String message);
071    
072    /**
073     * log level warn
074     * @param application application name
075     * @param message message to log
076     */
077    public void warn(String application, String message);
078    
079    /**
080     * log level error
081     * @param application application name
082     * @param message message to log
083     */
084    public void error(String application, String message);
085    
086    /**
087     * log level fatal
088     * @param application application name
089     * @param message message to log
090     */
091    public void fatal(String application, String message);
092
093    /**
094     * @return returns the log level of the log
095     */
096    public int getLogLevel();
097    
098    /**
099     * @param level sets the log level of the log
100     */
101    public void setLogLevel(int level);
102}