1 package org.apache.maven.monitor.logging; 2 3 18 19 import org.apache.maven.plugin.logging.Log; 20 import org.codehaus.plexus.logging.Logger; 21 22 25 public class DefaultLog 26 implements Log 27 { 28 29 private final Logger logger; 30 31 public DefaultLog( Logger logger ) 32 { 33 this.logger = logger; 34 } 35 36 public void debug( CharSequence content ) 37 { 38 logger.debug( toString( content ) ); 39 } 40 41 private String toString( CharSequence content ) 42 { 43 if ( content == null ) 44 { 45 return ""; 46 } 47 else 48 { 49 return content.toString(); 50 } 51 } 52 53 public void debug( CharSequence content, Throwable error ) 54 { 55 logger.debug( toString( content ), error ); 56 } 57 58 public void debug( Throwable error ) 59 { 60 logger.debug( "", error ); 61 } 62 63 public void info( CharSequence content ) 64 { 65 logger.info( toString( content ) ); 66 } 67 68 public void info( CharSequence content, Throwable error ) 69 { 70 logger.info( toString( content ), error ); 71 } 72 73 public void info( Throwable error ) 74 { 75 logger.info( "", error ); 76 } 77 78 public void warn( CharSequence content ) 79 { 80 logger.warn( toString( content ) ); 81 } 82 83 public void warn( CharSequence content, Throwable error ) 84 { 85 logger.warn( toString( content ), error ); 86 } 87 88 public void warn( Throwable error ) 89 { 90 logger.warn( "", error ); 91 } 92 93 public void error( CharSequence content ) 94 { 95 logger.error( toString( content ) ); 96 } 97 98 public void error( CharSequence content, Throwable error ) 99 { 100 logger.error( toString( content ), error ); 101 } 102 103 public void error( Throwable error ) 104 { 105 logger.error( "", error ); 106 } 107 108 public boolean isDebugEnabled() 109 { 110 return logger.isDebugEnabled(); 111 } 112 113 public boolean isInfoEnabled() 114 { 115 return logger.isInfoEnabled(); 116 } 117 118 public boolean isWarnEnabled() 119 { 120 return logger.isWarnEnabled(); 121 } 122 123 public boolean isErrorEnabled() 124 { 125 return logger.isErrorEnabled(); 126 } 127 128 } | Popular Tags |