1/* 2 * Copyright (c) 2006-2011 Christian Plattner. All rights reserved. 3 * Please refer to the LICENSE.txt for licensing details. 4 */ 5package ch.ethz.ssh2.log; 6 7import java.util.logging.Level; 8 9/** 10 * Logger delegating to JRE logging. 11 * 12 * @author Christian Plattner 13 * @version $Id: Logger.java 41 2011-06-02 10:36:41Z dkocher@sudo.ch $ 14 */ 15public class Logger 16{ 17 18 private java.util.logging.Logger delegate; 19 20 public static Logger getLogger(Class x) 21 { 22 return new Logger(x); 23 } 24 25 public Logger(Class x) 26 { 27 this.delegate = java.util.logging.Logger.getLogger(x.getName()); 28 } 29 30 public boolean isDebugEnabled() 31 { 32 return delegate.isLoggable(Level.FINER); 33 } 34 35 public void debug(String message) 36 { 37 delegate.fine(message); 38 } 39 40 public boolean isInfoEnabled() 41 { 42 return delegate.isLoggable(Level.FINE); 43 } 44 45 public void info(String message) 46 { 47 delegate.info(message); 48 } 49 50 public boolean isWarningEnabled() 51 { 52 return delegate.isLoggable(Level.WARNING); 53 } 54 55 public void warning(String message) 56 { 57 delegate.warning(message); 58 } 59}