You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by ce...@apache.org on 2001/02/06 16:11:39 UTC
cvs commit: jakarta-log4j/org/apache/log4j/net SMTPAppender.java
ceki 01/02/06 07:11:39
Modified: org/apache/log4j Priority.java PropertyConfigurator.java
org/apache/log4j/net SMTPAppender.java
Log:
Added K. Simons patch.
In net/SMTPAppender.java, corrected the close() bug occuring during simultaneous append+configuration.
Revision Changes Path
1.6 +18 -4 jakarta-log4j/org/apache/log4j/Priority.java
Index: Priority.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/Priority.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Priority.java 2001/01/19 16:45:28 1.5
+++ Priority.java 2001/02/06 15:11:37 1.6
@@ -6,6 +6,8 @@
* the LICENSE.APL file.
*/
+// Contributors: Kitching Simon <Si...@orange.ch>
+
package org.apache.log4j;
/**
@@ -15,7 +17,8 @@
<p>The <code>Priority</code> class may be subclassed to define a larger
priority set.
-
+
+ @author Ceki Gülcü
*/
public class Priority {
@@ -134,20 +137,30 @@
}
/**
- Convert an integerq passed as argument to a priority. If the
- conversion fails, then this method returns {@link #DEBUG}.
+ Convert an integer passed as argument to a priority. If the
+ conversion fails, then this method returns {@link #DEBUG}.
*/
public
static
Priority toPriority(int val) {
+ return toPriority(val, Priority.DEBUG);
+ }
+
+ /**
+ Convert an integer passed as argument to a priority. If the
+ conversion fails, then this method returns the specified default.
+ */
+ public
+ static
+ Priority toPriority(int val, Priority defaultPriority) {
switch(val) {
case DEBUG_INT: return DEBUG;
case INFO_INT: return INFO;
case WARN_INT: return WARN;
case ERROR_INT: return ERROR;
case FATAL_INT: return FATAL;
- default: return DEBUG;
+ default: return defaultPriority;
}
}
@@ -171,5 +184,6 @@
if(s.equals("FATAL")) return Priority.FATAL;
return defaultPriority;
}
+
}
1.14 +0 -1 jakarta-log4j/org/apache/log4j/PropertyConfigurator.java
Index: PropertyConfigurator.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/PropertyConfigurator.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- PropertyConfigurator.java 2001/02/03 22:39:22 1.13
+++ PropertyConfigurator.java 2001/02/06 15:11:37 1.14
@@ -511,7 +511,6 @@
additivity);
cat.setAdditivity(additivity);
}
-
}
/**
1.13 +1 -1 jakarta-log4j/org/apache/log4j/net/SMTPAppender.java
Index: SMTPAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/net/SMTPAppender.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SMTPAppender.java 2001/01/26 13:27:46 1.12
+++ SMTPAppender.java 2001/02/06 15:11:38 1.13
@@ -227,6 +227,7 @@
}
+ synchronized
public
void close() {
this.closed = true;
@@ -262,7 +263,6 @@
ErrorCode.ADDRESS_PARSE_FAILURE);
return null;
}
-
}
/**