| 1 | // Copyright (c) 2002 Dustin Sallings <dustin@spy.net> |
| 2 | |
| 3 | package net.spy.memcached.compat; |
| 4 | |
| 5 | import net.spy.memcached.compat.log.Logger; |
| 6 | import net.spy.memcached.compat.log.LoggerFactory; |
| 7 | |
| 8 | |
| 9 | /** |
| 10 | * Superclass for all Spy Objects. |
| 11 | */ |
| 12 | public class SpyObject extends Object { |
| 13 | |
| 14 | private transient Logger logger=null; |
| 15 | |
| 16 | /** |
| 17 | * Get an instance of SpyObject. |
| 18 | */ |
| 19 | public SpyObject() { |
| 20 | super(); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Get a Logger instance for this class. |
| 25 | * |
| 26 | * @return an appropriate logger instance. |
| 27 | */ |
| 28 | protected Logger getLogger() { |
| 29 | if(logger==null) { |
| 30 | logger=LoggerFactory.getLogger(getClass()); |
| 31 | } |
| 32 | return(logger); |
| 33 | } |
| 34 | |
| 35 | } |