dion 2003/01/16 14:41:33
Added: jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log
package.html TraceTag.java FatalTag.java
WarnTag.java LogTagSupport.java InfoTag.java
DebugTag.java ErrorTag.java LogTagLibrary.java
jelly/jelly-tags/log project.properties project.xml
.cvsignore maven.xml
Log:
Move log out of core.
Note: still mucho refactoring to do
Revision Changes Path
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/package.html
Index: package.html
===================================================================
<html>
<head>
</head>
<body>
<p>Custom tags for generating textual logging information using
<a href="http://jakarta.apache.org/commons/logging.html">commons-logging</a>
which will use either log4j, logkit or JDK1.4 logging
depending on the classpath and configuration.
</p>
</body>
</html>
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/TraceTag.java
Index: TraceTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/TraceTag.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: TraceTag.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
/**
* A tag which generates TRACE level logging statement using
* the given category name.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class TraceTag extends LogTagSupport {
public TraceTag() {
}
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws Exception {
Log log = getLog();
if ( log.isTraceEnabled() ) {
log.trace( getBodyText(isEncode()) );
}
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/FatalTag.java
Index: FatalTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/FatalTag.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: FatalTag.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
/**
* A tag which generates FATAL level logging statement using
* the given category name.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class FatalTag extends LogTagSupport {
public FatalTag() {
}
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws Exception {
Log log = getLog();
if ( log.isFatalEnabled() ) {
log.fatal( getBodyText(isEncode()) );
}
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/WarnTag.java
Index: WarnTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/WarnTag.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: WarnTag.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
/**
* A tag which generates WARN level logging statement using
* the given category name.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class WarnTag extends LogTagSupport {
public WarnTag() {
}
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws Exception {
Log log = getLog();
if ( log.isWarnEnabled() ) {
log.warn( getBodyText(isEncode()) );
}
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/LogTagSupport.java
Index: LogTagSupport.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/LogTagSupport.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: LogTagSupport.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* An abstract base class for any logging tag..
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public abstract class LogTagSupport extends TagSupport {
private Log log;
private boolean encode;
public LogTagSupport() {
}
// Properties
//-------------------------------------------------------------------------
/**
* @return the Log being used by this tag. If none is returned then a new one
will be created.
*/
public Log getLog() {
if ( log == null ) {
// use a default Log
// ### we could inherit from a parent tag?
log = LogFactory.getLog( getClass() );
}
return log;
}
/**
* Sets the name of the logger to use
*/
public void setName(String name) {
setLog( LogFactory.getLog(name) );
}
/** Sets the Log instance to use for logging. */
public void setLog(Log log) {
this.log = log;
}
/**
* Returns whether the body of this tag will be XML encoded or not.
*/
public boolean isEncode() {
return encode;
}
/**
* Sets whether the body of the tag should be encoded as text (so that < and
> are
* encoded as &lt; and &gt;) or leave the text as XML which is the
default.
*/
public void setEncode(boolean encode) {
this.encode = encode;
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/InfoTag.java
Index: InfoTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/InfoTag.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: InfoTag.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
/**
* A tag which generates INFO level logging statement using
* the given category name.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class InfoTag extends LogTagSupport {
public InfoTag() {
}
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws Exception {
Log log = getLog();
if ( log.isInfoEnabled() ) {
log.info( getBodyText(isEncode()) );
}
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/DebugTag.java
Index: DebugTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/DebugTag.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: DebugTag.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
/**
* A tag which generates DEBUG level logging statement using
* the given category name.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class DebugTag extends LogTagSupport {
public DebugTag() {
}
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws Exception {
Log log = getLog();
if ( log.isDebugEnabled() ) {
log.debug( getBodyText(isEncode()) );
}
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/ErrorTag.java
Index: ErrorTag.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/ErrorTag.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: ErrorTag.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.XMLOutput;
import org.apache.commons.logging.Log;
/**
* A tag which generates ERROR level logging statement using
* the given category name.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class ErrorTag extends LogTagSupport {
public ErrorTag() {
}
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws Exception {
Log log = getLog();
if ( log.isErrorEnabled() ) {
log.error( getBodyText(isEncode()) );
}
}
}
1.1
jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/LogTagLibrary.java
Index: LogTagLibrary.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/log/src/java/org/apache/commons/jelly/tags/log/LogTagLibrary.java,v
1.1 2003/01/16 22:41:32 dion Exp $
* $Revision: 1.1 $
* $Date: 2003/01/16 22:41:32 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* $Id: LogTagLibrary.java,v 1.1 2003/01/16 22:41:32 dion Exp $
*/
package org.apache.commons.jelly.tags.log;
import org.apache.commons.jelly.TagLibrary;
/** Describes the Taglib. This class could be generated by XDoclet
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision: 1.1 $
*/
public class LogTagLibrary extends TagLibrary {
public LogTagLibrary() {
registerTag("trace", TraceTag.class);
registerTag("debug", DebugTag.class);
registerTag("info", InfoTag.class);
registerTag("warn", WarnTag.class);
registerTag("error", ErrorTag.class);
registerTag("fatal", FatalTag.class);
}
}
1.1 jakarta-commons-sandbox/jelly/jelly-tags/log/project.properties
Index: project.properties
===================================================================
# -------------------------------------------------------------------
# P R O J E C T P R O P E R T I E S
# -------------------------------------------------------------------
maven.junit.fork=true
maven.compile.deprecation = on
# Installation dir
maven.dist.install.dir = /usr/local/jelly
maven.checkstyle.properties=../tag-checkstyle.properties
1.1 jakarta-commons-sandbox/jelly/jelly-tags/log/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
<!-- see file for description -->
<!ENTITY commonDeps SYSTEM "file:../../commonDependencies.ent">
]>
<project>
<extend>../tag-project.xml</extend>
<id>commons-jelly-tags-log</id>
<name>commons-jelly-tags-log</name>
<package>org.apache.commons.jelly.tags.log</package>
<description>
The Jelly Log Tag Library
</description>
<shortDescription>Commons Jelly Log Tag Library</shortDescription>
<url>http://jakarta.apache.org/commons/sandbox/jelly/tags/log/</url>
<siteDirectory>/www/jakarta.apache.org/commons/sandbox/jelly/log/</siteDirectory>
<distributionDirectory>/www/jakarta.apache.org/builds/jakarta-commons-sandbox/jelly/tags/log</distributionDirectory>
<repository>
<connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:jakarta-commons-sandbox/jelly/jelly-tags/log/</connection>
<url>http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/jelly/jelly-tags/log/</url>
</repository>
<dependencies>
&commonDeps;
<!-- START for compilation -->
<dependency>
<id>commons-jelly</id>
<version>SNAPSHOT</version>
</dependency>
<!-- END for compilation -->
</dependencies>
</project>
1.1 jakarta-commons-sandbox/jelly/jelly-tags/log/.cvsignore
Index: .cvsignore
===================================================================
target
maven.log
1.1 jakarta-commons-sandbox/jelly/jelly-tags/log/maven.xml
Index: maven.xml
===================================================================
<project default="java:jar">
</project>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>