001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.mina.filter.logging; 021 022/** 023 * Defines a logging level. 024 * 025 * @author <a href="http://mina.apache.org">Apache MINA Project</a> 026 * 027 * @see LoggingFilter 028 */ 029public enum LogLevel { 030 031 /** 032 * {@link LogLevel} which logs messages on the TRACE level. 033 */ 034 TRACE(5), 035 036 /** 037 * {@link LogLevel} which logs messages on the DEBUG level. 038 */ 039 DEBUG(4), 040 041 /** 042 * {@link LogLevel} which logs messages on the INFO level. 043 */ 044 INFO(3), 045 046 /** 047 * {@link LogLevel} which logs messages on the WARN level. 048 */ 049 WARN(2), 050 051 /** 052 * {@link LogLevel} which logs messages on the ERROR level. 053 */ 054 ERROR(1), 055 056 /** 057 * {@link LogLevel} which will not log any information 058 */ 059 NONE(0); 060 061 /** The internal numeric value associated with the log level */ 062 private int level; 063 064 /** 065 * Create a new instance of a LogLevel. 066 * 067 * @param level The log level 068 */ 069 private LogLevel(int level) { 070 this.level = level; 071 } 072 073 /** 074 * @return The numeric value associated with the log level 075 */ 076 public int getLevel() { 077 return level; 078 } 079}