View Javadoc

1   /*$Id: CommonsLoggingFacade.java,v 1.2 2005/04/25 12:13:30 clq2 Exp $
2    * Created on 24-Feb-2005
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10  **/
11  package org.astrogrid.common.namegen;
12  
13  import org.apache.commons.logging.Log;
14  import org.apache.commons.logging.LogFactory;
15  import org.apache.commons.transaction.util.LoggerFacade;
16  
17  
18  /*** irritating - jakarta transactions doesn't integration with commons logging yet. need to write my own facade for it... ho hum */
19  public class CommonsLoggingFacade implements LoggerFacade {
20  
21      public CommonsLoggingFacade(Log logger) {
22          this.logger = logger;
23      }
24      protected final Log logger;
25      
26      /***
27       * @see org.apache.commons.transaction.util.LoggerFacade#createLogger(java.lang.String)
28       */
29      public LoggerFacade createLogger(String arg0) {
30          return new CommonsLoggingFacade(LogFactory.getLog(arg0));
31      }
32  
33      /***
34       * @see org.apache.commons.transaction.util.LoggerFacade#logInfo(java.lang.String)
35       */
36      public void logInfo(String arg0) {
37          logger.info(arg0);
38      }
39  
40      /***
41       * @see org.apache.commons.transaction.util.LoggerFacade#logFine(java.lang.String)
42       */
43      public void logFine(String arg0) {
44          logger.debug(arg0);
45      }
46  
47      /***
48       * @see org.apache.commons.transaction.util.LoggerFacade#isFineEnabled()
49       */
50      public boolean isFineEnabled() {
51          return logger.isDebugEnabled();
52      }
53  
54      /***
55       * @see org.apache.commons.transaction.util.LoggerFacade#logFiner(java.lang.String)
56       */
57      public void logFiner(String arg0) {
58          logger.trace(arg0);
59      }
60  
61      /***
62       * @see org.apache.commons.transaction.util.LoggerFacade#isFinerEnabled()
63       */
64      public boolean isFinerEnabled() {
65          return logger.isTraceEnabled();
66      }
67  
68      /***
69       * @see org.apache.commons.transaction.util.LoggerFacade#logFinest(java.lang.String)
70       */
71      public void logFinest(String arg0) {
72          logger.trace(arg0);
73      }
74  
75      /***
76       * @see org.apache.commons.transaction.util.LoggerFacade#isFinestEnabled()
77       */
78      public boolean isFinestEnabled() {
79          return logger.isTraceEnabled();
80      }
81  
82      /***
83       * @see org.apache.commons.transaction.util.LoggerFacade#logWarning(java.lang.String)
84       */
85      public void logWarning(String arg0) {
86          logger.warn(arg0);
87      }
88  
89      /***
90       * @see org.apache.commons.transaction.util.LoggerFacade#logWarning(java.lang.String, java.lang.Throwable)
91       */
92      public void logWarning(String arg0, Throwable arg1) {
93          logger.warn(arg0,arg1);
94      }
95  
96      /***
97       * @see org.apache.commons.transaction.util.LoggerFacade#logSevere(java.lang.String)
98       */
99      public void logSevere(String arg0) {
100         logger.error(arg0);
101     }
102 
103     /***
104      * @see org.apache.commons.transaction.util.LoggerFacade#logSevere(java.lang.String, java.lang.Throwable)
105      */
106     public void logSevere(String arg0, Throwable arg1) {
107         logger.error(arg0,arg1);
108     }
109 }
110 
111 /* 
112 $Log: CommonsLoggingFacade.java,v $
113 Revision 1.2  2005/04/25 12:13:30  clq2
114 common-nww-1035
115 
116 Revision 1.1.2.1  2005/04/11 11:03:22  nw
117 moved name generator into common from filemanager - can then
118 reuse in jes too.
119 
120 Revision 1.2  2005/03/11 13:37:05  clq2
121 new filemanager merged with filemanager-nww-jdt-903-943
122 
123 Revision 1.1.2.1  2005/03/01 23:43:38  nw
124 split code inito client and server projoects again.
125 
126 Revision 1.1.2.1  2005/02/27 23:03:12  nw
127 first cut of talking to filestore
128 
129 Revision 1.1.2.1  2005/02/25 12:33:27  nw
130 finished transactional store
131  
132 */