//# 0 errors, 242 messages
//#
/*
    //#Logging.java:1:1: class: com.dmdirc.parser.irc.Logging$LogLevel
    //#Logging.java:1:1: class: com.dmdirc.parser.irc.Logging
    //#Logging.java:1:1: method: com.dmdirc.parser.irc.Logging.com.dmdirc.parser.irc.Logging__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.parser.irc;

import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;

/**
 * Logging using log4j if available.
 */
public class Logging {
	/** Available Log Levels */
	public enum LogLevel {
    //#Logging.java:33: method: Logging$LogLevel[] com.dmdirc.parser.irc.Logging$LogLevel.values()
    //#input(Logging$LogLevel[] values()): $VALUES
    //#input(Logging$LogLevel[] values()): $VALUES.length
    //#input(Logging$LogLevel[] values()): $VALUES[0..6]
    //#output(Logging$LogLevel[] values()): new Logging$LogLevel[](values#1) num objects
    //#output(Logging$LogLevel[] values()): return_value.length
    //#output(Logging$LogLevel[] values()): return_value[0..6]
    //#output(Logging$LogLevel[] values()): return_value
    //#new obj(Logging$LogLevel[] values()): new Logging$LogLevel[](values#1)
    //#pre[1] (Logging$LogLevel[] values()): (soft) init'ed($VALUES[0..6])
    //#post(Logging$LogLevel[] values()): return_value == &new Logging$LogLevel[](values#1)
    //#post(Logging$LogLevel[] values()): new Logging$LogLevel[](values#1) num objects == 1
    //#post(Logging$LogLevel[] values()): return_value.length == 6
    //#post(Logging$LogLevel[] values()): return_value[0..6] == One-of{$VALUES[0..6], undefined}
    //#Logging.java:33: end of method: Logging$LogLevel[] com.dmdirc.parser.irc.Logging$LogLevel.values()
    //#Logging.java:33: method: Logging$LogLevel com.dmdirc.parser.irc.Logging$LogLevel.valueOf(String)
    //#input(Logging$LogLevel valueOf(String)): __Descendant_Table[com/dmdirc/parser/irc/Logging$LogLevel]
    //#input(Logging$LogLevel valueOf(String)): __Descendant_Table[others]
    //#input(Logging$LogLevel valueOf(String)): name
    //#output(Logging$LogLevel valueOf(String)): return_value
    //#presumption(Logging$LogLevel valueOf(String)): java.lang.Enum:valueOf(...).__Tag@33 == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(Logging$LogLevel valueOf(String)): init'ed(return_value)
    //#Logging.java:33: end of method: Logging$LogLevel com.dmdirc.parser.irc.Logging$LogLevel.valueOf(String)
		TRACE("trace", "isTraceEnabled"),
    //#Logging.java:34: method: com.dmdirc.parser.irc.Logging$LogLevel.com.dmdirc.parser.irc.Logging$LogLevel__static_init
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): __Descendant_Table[com/dmdirc/parser/irc/Logging$LogLevel]
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): __Dispatch_Table.getCheckMethodName()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): __Dispatch_Table.getMethodName()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#1) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE.__Tag
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE.checkMethodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE.methodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#2) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG.__Tag
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG.checkMethodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG.methodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#3) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO.__Tag
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO.checkMethodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO.methodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#4) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN.__Tag
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN.checkMethodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN.methodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#5) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR.__Tag
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR.checkMethodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR.methodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#6) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL.__Tag
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL.checkMethodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL.methodName
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel[](Logging$LogLevel__static_init#7) num objects
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES.length
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[0]
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[1]
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[2]
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[3]
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[4]
    //#output(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[5]
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#1)
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#2)
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#3)
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#4)
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#5)
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#6)
    //#new obj(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel[](Logging$LogLevel__static_init#7)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES == &new Logging$LogLevel[](Logging$LogLevel__static_init#7)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG == &new Logging$LogLevel(Logging$LogLevel__static_init#2)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[1] == &new Logging$LogLevel(Logging$LogLevel__static_init#2)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR == &new Logging$LogLevel(Logging$LogLevel__static_init#5)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[4] == &new Logging$LogLevel(Logging$LogLevel__static_init#5)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL == &new Logging$LogLevel(Logging$LogLevel__static_init#6)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[5] == &new Logging$LogLevel(Logging$LogLevel__static_init#6)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO == &new Logging$LogLevel(Logging$LogLevel__static_init#3)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[2] == &new Logging$LogLevel(Logging$LogLevel__static_init#3)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE == &new Logging$LogLevel(Logging$LogLevel__static_init#1)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[0] == &new Logging$LogLevel(Logging$LogLevel__static_init#1)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN == &new Logging$LogLevel(Logging$LogLevel__static_init#4)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES[3] == &new Logging$LogLevel(Logging$LogLevel__static_init#4)
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): __Descendant_Table[com/dmdirc/parser/irc/Logging$LogLevel] == &__Dispatch_Table
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): __Dispatch_Table.getCheckMethodName()Ljava/lang/String; == &getCheckMethodName
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): __Dispatch_Table.getMethodName()Ljava/lang/String; == &getMethodName
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#1) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#2) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#3) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#4) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#5) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel(Logging$LogLevel__static_init#6) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): new Logging$LogLevel[](Logging$LogLevel__static_init#7) num objects == 1
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE.__Tag == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG.__Tag == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO.__Tag == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN.__Tag == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR.__Tag == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL.__Tag == com/dmdirc/parser/irc/Logging$LogLevel
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE.checkMethodName == &"isTraceEnabled"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): TRACE.methodName == &"trace"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG.checkMethodName == &"isDebugEnabled"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): DEBUG.methodName == &"debug"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO.checkMethodName == &"isInfoEnabled"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): INFO.methodName == &"info"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN.checkMethodName == &"isWarnEnabled"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): WARN.methodName == &"warn"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR.checkMethodName == &"isErrorEnabled"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): ERROR.methodName == &"error"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL.checkMethodName == &"isFatalEnabled"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): FATAL.methodName == &"fatal"
    //#post(com.dmdirc.parser.irc.Logging$LogLevel__static_init): $VALUES.length == 6
    //#unanalyzed(com.dmdirc.parser.irc.Logging$LogLevel__static_init): Effects-of-calling:java.lang.Enum
		DEBUG("debug", "isDebugEnabled"),
		INFO("info", "isInfoEnabled"),
		WARN("warn", "isWarnEnabled"),
		ERROR("error", "isErrorEnabled"),
		FATAL("fatal", "isFatalEnabled");
    //#Logging.java:39: end of method: com.dmdirc.parser.irc.Logging$LogLevel.com.dmdirc.parser.irc.Logging$LogLevel__static_init
		
		/** Method name */
		private final String methodName;
		
		/** Check Method name */
		private final String checkMethodName;
		
		/**
		 * Create a new LogLevel
		 *
		 * @param methodName Name of method in log4j to log to
		 * @param checkMethodName Name of method in log4j to sue to check logging
		 */
		private LogLevel(final String methodName, final String checkMethodName) {
    //#Logging.java:53: method: void com.dmdirc.parser.irc.Logging$LogLevel.com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)
    //#input(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): Param_1
    //#input(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): Param_2
    //#input(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): checkMethodName
    //#input(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): methodName
    //#input(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): this
    //#output(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): this.checkMethodName
    //#output(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): this.methodName
    //#post(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): this.checkMethodName == checkMethodName
    //#post(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): init'ed(this.checkMethodName)
    //#post(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): this.methodName == methodName
    //#post(void com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)): init'ed(this.methodName)
			this.methodName = methodName;
			this.checkMethodName = checkMethodName;
		}
    //#Logging.java:56: end of method: void com.dmdirc.parser.irc.Logging$LogLevel.com.dmdirc.parser.irc.Logging$LogLevel(String, int, String, String)
		
		/**
		 * Get the Name of method in log4j to log to
		 *
		 * @return Name of method in log4j to log to
		 */
		public String getMethodName() { return methodName; }
    //#Logging.java:63: method: String com.dmdirc.parser.irc.Logging$LogLevel.getMethodName()
    //#input(String getMethodName()): this
    //#input(String getMethodName()): this.methodName
    //#output(String getMethodName()): return_value
    //#post(String getMethodName()): return_value == this.methodName
    //#post(String getMethodName()): init'ed(return_value)
    //#Logging.java:63: end of method: String com.dmdirc.parser.irc.Logging$LogLevel.getMethodName()
		
		/**
		 * Get the Name of the check method in log4j
		 *
		 * @return Name of check method in log4j
		 */
		public String getCheckMethodName() { return checkMethodName; }
    //#Logging.java:70: method: String com.dmdirc.parser.irc.Logging$LogLevel.getCheckMethodName()
    //#input(String getCheckMethodName()): this
    //#input(String getCheckMethodName()): this.checkMethodName
    //#output(String getCheckMethodName()): return_value
    //#post(String getCheckMethodName()): return_value == this.checkMethodName
    //#post(String getCheckMethodName()): init'ed(return_value)
    //#Logging.java:70: end of method: String com.dmdirc.parser.irc.Logging$LogLevel.getCheckMethodName()
	};
	
	/** Singleton Instance of Logging. */
	private static Logging me;
	
	/** Is log4j available. */
	private final boolean isAvailable;
	
	/** "Log" object if available. */
	private Object log = null;
	
	/**
	 * Get an instance of Logging.
	 *
	 * @return The instance of Logging
	 */
	public static Logging getLogging() {
		if (me == null) { me = new Logging(); }
    //#Logging.java:88: method: Logging com.dmdirc.parser.irc.Logging.getLogging()
    //#input(Logging getLogging()): me
    //#output(Logging getLogging()): me
    //#output(Logging getLogging()): new Logging(getLogging#1) num objects
    //#output(Logging getLogging()): new Logging(getLogging#1).__Tag
    //#output(Logging getLogging()): new Logging(getLogging#1).isAvailable
    //#output(Logging getLogging()): new Logging(getLogging#1).log
    //#output(Logging getLogging()): return_value
    //#new obj(Logging getLogging()): new Logging(getLogging#1)
    //#pre[1] (Logging getLogging()): init'ed(me)
    //#post(Logging getLogging()): me == One-of{old me, &new Logging(getLogging#1)}
    //#post(Logging getLogging()): me != null
    //#post(Logging getLogging()): return_value == me
    //#post(Logging getLogging()): new Logging(getLogging#1) num objects <= 1
    //#post(Logging getLogging()): new Logging(getLogging#1).__Tag == com/dmdirc/parser/irc/Logging
    //#post(Logging getLogging()): init'ed(new Logging(getLogging#1).isAvailable)
    //#post(Logging getLogging()): init'ed(new Logging(getLogging#1).log)
    //#unanalyzed(Logging getLogging()): Effects-of-calling:java.lang.Class:forName
    //#unanalyzed(Logging getLogging()): Effects-of-calling:java.lang.Class:getMethod
    //#unanalyzed(Logging getLogging()): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(Logging getLogging()): Effects-of-calling:java.lang.reflect.Method:invoke
    //#unanalyzed(Logging getLogging()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#test_vector(Logging getLogging()): me: Inverse{null}, Addr_Set{null}
		return me;
    //#Logging.java:89: end of method: Logging com.dmdirc.parser.irc.Logging.getLogging()
	}
	
	/** Create a new Logging. */
	@SuppressWarnings("unchecked")
	private Logging() {
    //#Logging.java:94: method: void com.dmdirc.parser.irc.Logging.com.dmdirc.parser.irc.Logging()
    //#input(void com.dmdirc.parser.irc.Logging()): this
    //#output(void com.dmdirc.parser.irc.Logging()): this.isAvailable
    //#output(void com.dmdirc.parser.irc.Logging()): this.log
    //#presumption(void com.dmdirc.parser.irc.Logging()): java.lang.Class:getMethod(...)@104 != null
    //#post(void com.dmdirc.parser.irc.Logging()): init'ed(this.isAvailable)
    //#post(void com.dmdirc.parser.irc.Logging()): init'ed(this.log)
    //#test_vector(void com.dmdirc.parser.irc.Logging()): java.lang.Class:forName(...)@100: Addr_Set{null}, Inverse{null}
		boolean classExists = false;
		try {
			Class factory = null;
			// Check for classes
			Class.forName("org.apache.commons.logging.Log");
			factory = Class.forName("org.apache.commons.logging.LogFactory");
		
			classExists = (factory != null);
			if (classExists) {
				final Method getLog = factory.getMethod("getLog", new Class[]{Class.class});
				log = getLog.invoke(null, this.getClass());
			}
		} catch (ClassNotFoundException cnfe) {
		} catch (NoSuchMethodException nsme) {
		} catch (IllegalAccessException iae) {
		} catch (InvocationTargetException ite) {
		}
		
		isAvailable = (classExists && log != null);
	}
    //#Logging.java:114: end of method: void com.dmdirc.parser.irc.Logging.com.dmdirc.parser.irc.Logging()
	
	/**
	 * Check is a log level is available.
	 *
	 * @param level Level to check
	 */
	public boolean levelEnabled(final LogLevel level) {
		if (isAvailable) {
    //#Logging.java:122: method: bool com.dmdirc.parser.irc.Logging.levelEnabled(Logging$LogLevel)
    //#input(bool levelEnabled(Logging$LogLevel)): level
    //#input(bool levelEnabled(Logging$LogLevel)): level.checkMethodName
    //#input(bool levelEnabled(Logging$LogLevel)): this
    //#input(bool levelEnabled(Logging$LogLevel)): this.isAvailable
    //#input(bool levelEnabled(Logging$LogLevel)): this.log
    //#output(bool levelEnabled(Logging$LogLevel)): return_value
    //#pre[1] (bool levelEnabled(Logging$LogLevel)): (soft) level != null
    //#pre[5] (bool levelEnabled(Logging$LogLevel)): (soft) this.log != null
    //#presumption(bool levelEnabled(Logging$LogLevel)): java.lang.Class:getMethod(...)@124 != null
    //#presumption(bool levelEnabled(Logging$LogLevel)): java.lang.Object:getClass(...)@124 != null
    //#presumption(bool levelEnabled(Logging$LogLevel)): java.lang.reflect.Method:invoke(...)@125 != null
    //#post(bool levelEnabled(Logging$LogLevel)): init'ed(return_value)
    //#test_vector(bool levelEnabled(Logging$LogLevel)): this.isAvailable: {0}, {1}
			try {
				final Method check = log.getClass().getMethod(level.getCheckMethodName(), new Class[0]);
				return (Boolean)check.invoke(log, new Object[0]);
			} catch (NoSuchMethodException nsme) {
			} catch (IllegalAccessException iae) {
			} catch (InvocationTargetException ite) {
			}
		}
		
		return false;
    //#Logging.java:132: end of method: bool com.dmdirc.parser.irc.Logging.levelEnabled(Logging$LogLevel)
	}
	
	/**
	 * Log a message if log4j is available.
	 *
	 * @param level Level to log at
	 * @param message Message to log
	 */
	public void log(final LogLevel level, final String message) {
		log(level, message, null);
    //#Logging.java:142: method: void com.dmdirc.parser.irc.Logging.log(Logging$LogLevel, String)
    //#input(void log(Logging$LogLevel, String)): __Descendant_Table[com/dmdirc/parser/irc/Logging]
    //#input(void log(Logging$LogLevel, String)): __Descendant_Table[others]
    //#input(void log(Logging$LogLevel, String)): __Dispatch_Table.log(Lcom/dmdirc/parser/irc/Logging$LogLevel;Ljava/lang/String;Ljava/lang/Throwable;)V
    //#input(void log(Logging$LogLevel, String)): level
    //#input(void log(Logging$LogLevel, String)): level.methodName
    //#input(void log(Logging$LogLevel, String)): message
    //#input(void log(Logging$LogLevel, String)): this
    //#input(void log(Logging$LogLevel, String)): this.__Tag
    //#input(void log(Logging$LogLevel, String)): this.isAvailable
    //#input(void log(Logging$LogLevel, String)): this.log
    //#pre[5] (void log(Logging$LogLevel, String)): this.__Tag == com/dmdirc/parser/irc/Logging
    //#pre[1] (void log(Logging$LogLevel, String)): (soft) level != null
    //#pre[7] (void log(Logging$LogLevel, String)): (soft) this.log != null
    //#unanalyzed(void log(Logging$LogLevel, String)): Effects-of-calling:java.lang.Class:getMethod
    //#unanalyzed(void log(Logging$LogLevel, String)): Effects-of-calling:java.lang.Object:getClass
    //#unanalyzed(void log(Logging$LogLevel, String)): Effects-of-calling:java.lang.reflect.Method:invoke
    //#unanalyzed(void log(Logging$LogLevel, String)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
	}
    //#Logging.java:143: end of method: void com.dmdirc.parser.irc.Logging.log(Logging$LogLevel, String)
	
	/**
	 * Log a message if log4j is available.
	 *
	 * @param level Level to log at
	 * @param message Message to log
	 * @param throwable Throwable to log alongside message
	 */
	public void log(final LogLevel level, final String message, final Throwable throwable) {
		if (!isAvailable) { return; }
    //#Logging.java:153: method: void com.dmdirc.parser.irc.Logging.log(Logging$LogLevel, String, Throwable)
    //#input(void log(Logging$LogLevel, String, Throwable)): level
    //#input(void log(Logging$LogLevel, String, Throwable)): level.methodName
    //#input(void log(Logging$LogLevel, String, Throwable)): message
    //#input(void log(Logging$LogLevel, String, Throwable)): this
    //#input(void log(Logging$LogLevel, String, Throwable)): this.isAvailable
    //#input(void log(Logging$LogLevel, String, Throwable)): this.log
    //#input(void log(Logging$LogLevel, String, Throwable)): throwable
    //#pre[2] (void log(Logging$LogLevel, String, Throwable)): (soft) level != null
    //#pre[7] (void log(Logging$LogLevel, String, Throwable)): (soft) this.log != null
    //#presumption(void log(Logging$LogLevel, String, Throwable)): java.lang.Class:getMethod(...)@156 != null
    //#presumption(void log(Logging$LogLevel, String, Throwable)): java.lang.Class:getMethod(...)@159 != null
    //#presumption(void log(Logging$LogLevel, String, Throwable)): java.lang.Object:getClass(...)@156 != null
    //#presumption(void log(Logging$LogLevel, String, Throwable)): java.lang.Object:getClass(...)@159 != null
    //#test_vector(void log(Logging$LogLevel, String, Throwable)): this.isAvailable: {1}, {0}
    //#test_vector(void log(Logging$LogLevel, String, Throwable)): throwable: Inverse{null}, Addr_Set{null}
		try {
			if (throwable == null) {
				final Method method = log.getClass().getMethod(level.getMethodName(), new Class[]{String.class});
				method.invoke(log, new Object[]{message});
			} else {
				final Method method = log.getClass().getMethod(level.getMethodName(), new Class[]{String.class, Throwable.class});
				method.invoke(log, new Object[]{message, throwable});
			}
		} catch (NoSuchMethodException nsme) {
		} catch (IllegalAccessException iae) {
		} catch (InvocationTargetException ite) {
		}
	}
    //#Logging.java:166: end of method: void com.dmdirc.parser.irc.Logging.log(Logging$LogLevel, String, Throwable)
}
    //#Logging.java:: end of class: com.dmdirc.parser.irc.Logging$LogLevel
    //#output(com.dmdirc.parser.irc.Logging__static_init): __Descendant_Table[com/dmdirc/parser/irc/Logging]
    //#output(com.dmdirc.parser.irc.Logging__static_init): __Dispatch_Table.levelEnabled(Lcom/dmdirc/parser/irc/Logging$LogLevel;)Z
    //#output(com.dmdirc.parser.irc.Logging__static_init): __Dispatch_Table.log(Lcom/dmdirc/parser/irc/Logging$LogLevel;Ljava/lang/String;)V
    //#output(com.dmdirc.parser.irc.Logging__static_init): __Dispatch_Table.log(Lcom/dmdirc/parser/irc/Logging$LogLevel;Ljava/lang/String;Ljava/lang/Throwable;)V
    //#post(com.dmdirc.parser.irc.Logging__static_init): __Descendant_Table[com/dmdirc/parser/irc/Logging] == &__Dispatch_Table
    //#post(com.dmdirc.parser.irc.Logging__static_init): __Dispatch_Table.levelEnabled(Lcom/dmdirc/parser/irc/Logging$LogLevel;)Z == &levelEnabled
    //#post(com.dmdirc.parser.irc.Logging__static_init): __Dispatch_Table.log(Lcom/dmdirc/parser/irc/Logging$LogLevel;Ljava/lang/String;)V == &log
    //#post(com.dmdirc.parser.irc.Logging__static_init): __Dispatch_Table.log(Lcom/dmdirc/parser/irc/Logging$LogLevel;Ljava/lang/String;Ljava/lang/Throwable;)V == &log
    //#Logging.java:: end of method: com.dmdirc.parser.irc.Logging.com.dmdirc.parser.irc.Logging__static_init
    //#Logging.java:: end of class: com.dmdirc.parser.irc.Logging
