public static DataSource create ( DataSource ds , Log log ) { if ( ds == null ) { throw new IllegalArgumentException ( ) ; } if ( log == null ) { log = LogFactory . getLog ( LoggingDataSource . class ) ; } if ( ! log . isDebugEnabled ( ) ) { return ds ; } return new LoggingDataSource ( log , ds ) ; }
Wraps the given DataSource which logs to the given log . If debug logging is disabled the original DataSource is returned .