/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* ident "%Z%%M% %I% %E% SMI" */
/**
* <code>syslog(3C)</code> severity levels defined in
*/
/**
*/
/**
*/
/**
*/
/**
*/
/**
*/
/**
*/
/**
*/
/**
*/
/**
* Maps static instances by name.
*/
/**
* LOG_EMERG
*/
/**
* LOG_ALERT
*/
/**
* LOG_CRIT
*/
/**
* LOG_ERR
*/
/**
* LOG_WARNING
*/
/**
* LOG_NOTICE
*/
/**
* LOG_INFO
*/
/**
* LOG_DEBUG
*/
/**
* Add aliases.
*/
static {
}
/**
* Disallowed overidden constant Level
*/
/**
* Disallowed overidden constant Level
*/
/**
* Disallowed overidden constant Level
*/
/**
* Disallowed overidden constant Level
*/
/**
* Disallowed overidden constant Level
*/
/**
* See getNative().
*/
private int severity;
/**
* Constructs a Severity with the given native severity, Java
* logging level, and name.
*/
{
}
/**
* Returns the Severity closest in meaning to the given Level.
* This is meant to be used by SyslogHandler to determine a
* proper Severity for Records which only specify a Level.
*
* <ul>
* <li>Level.SEVERE or higher becomes Severity.ERR
* <li>Level.WARNING becomes Severity.WARNING
* <li>Level.INFO becomes Severity.INFO
* <li>Level.FINE becomes Severity.DEBUG
* </ul>
*
* If the level is below Level.FINE, i.e. the level is too low
* for syslog, then null is returned.
*/
{
if (l instanceof Severity)
return (Severity)l;
else {
return (ERR);
return (WARNING);
return (INFO);
return (INFO);
return (DEBUG);
return (null);
}
}
/**
* Returns the native <code>syslog(3C)</code> severity.
*/
public int getNative()
{
return (severity);
}
/**
* Returns the Severity object with the given name, interpreted
* case-insensitively.
*
* @throws IllegalArgumentException if the name isn't of a known
* severity.
*/
{
name.toUpperCase());
throw new IllegalArgumentException();
else
return (severity);
}
/**
* Returns the Severity object with the given name, interpreted
* case-insensitively.
*
* @throws IllegalArgumentException if the name isn't of a known
* severity.
*/
{
}
}