From: cvs@openprivacy.orgCVS update: talon/src/java/talon/implementations
Date: Wednesday March 21, 19101 @ 21:46
Author: burton
CVSWEB Options: -------------------
Main CVSWeb: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi
View this module: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/implementations
-----------------------------------
Update of /usr/local/cvs/public/talon/src/java/talon/implementations
In directory giga:/tmp/cvs-serv29010/src/java/talon/implementations
Modified Files:
SimpleLogger.java
Log Message:
...
*****************************************************************
File: talon/src/java/talon/implementations/SimpleLogger.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/implementations/SimpleLogger.java?annotate=1.6
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/implementations/SimpleLogger.java?rev=1.6&content-type=text/x-cvsweb-markup
CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/implementations/SimpleLogger.java.diff?r1=1.6&r2=1.5
-----------------------------------
Index: talon/src/java/talon/implementations/SimpleLogger.java
diff -u talon/src/java/talon/implementations/SimpleLogger.java:1.5 talon/src/java/talon/implementations/SimpleLogger.java:1.6
--- talon/src/java/talon/implementations/SimpleLogger.java:1.5 Wed Mar 14 17:33:38 2001
+++ talon/src/java/talon/implementations/SimpleLogger.java Wed Mar 21 21:46:17 2001
@@ -30,7 +30,7 @@
* - stderr -> If true, log to stderr
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public class SimpleLogger extends BaseComponent implements Component, Logger {
@@ -75,7 +75,7 @@
* Default constructor when used as a Component
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public SimpleLogger() { }
@@ -83,7 +83,7 @@
* Default constructor when used as an Object
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public SimpleLogger( ComponentHandle handle,
boolean debug,
@@ -103,7 +103,7 @@
*
* @see Component
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void init() throws TalonException {
@@ -129,7 +129,7 @@
* Log a message
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void message( String message ) {
message( null, message );
@@ -139,7 +139,7 @@
* Log a message
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void message( Object source, String message ) {
logString( source, getLogPrefix() + " -> " + message );
@@ -149,7 +149,7 @@
* Log an error
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void error( String message ) {
error( null, message );
@@ -159,7 +159,7 @@
* Log an error
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void error( Object source, String message ) {
logString( source, getLogPrefix() + " -> ERROR: " + message );
@@ -170,7 +170,7 @@
* Log a warning
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void warning( String message ) {
warning( null, message );
@@ -180,7 +180,7 @@
* Log a warning
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void warning( Object source, String message ) {
logString( source, getLogPrefix() + " -> WARNING: " + message );
@@ -190,7 +190,7 @@
* Log a debug message
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void debug( String message ) {
debug( null, message );
@@ -200,7 +200,7 @@
* Log a debug message
*
* @author <A HREF="mailto:burton@apache.org">Kevin A. Burton</A>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
public void debug( Object source, String message ) {
@@ -213,7 +213,7 @@
/**
* @see #logString
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
private void logString( String s ) {
logString( null, s);
@@ -224,7 +224,7 @@
*
* @param source Object source where this was logged from
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
private void logString( Object source, String s ) {
@@ -277,7 +277,7 @@
* Get the prefix for log output.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
private String getLogPrefix() {
return this.project + " [" + this.getDate() + "]";
@@ -289,7 +289,7 @@
* Determine if it is OK to log to disk
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
private boolean isFileEnabled() {
@@ -332,7 +332,7 @@
* Get the date/time in a nice format for logging.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: SimpleLogger.java,v 1.5 2001/03/15 01:33:38 burton Exp $
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
*/
private String getDate() {
@@ -367,6 +367,26 @@
return date.toString();
+ }
+
+
+
+ /**
+ * @see Logger
+ * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
+ * @version $Id: SimpleLogger.java,v 1.6 2001/03/22 05:46:17 burton Exp $
+ */
+ public void error( Throwable t ) {
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+
+ t.printStackTrace( new PrintStream( bos ) );
+
+
+ //FIXME: this needs to actually pretty print the message line by line.
+ //This works for now though.
+ this.message( bos.toString() );
+
}
This archive was generated by hypermail 2b30 : Wed Mar 21 2001 - 21:46:49 PST