getting the class name from static context
807603Feb 18 2008 — edited Feb 18 2008I've seen this pattern in lots of Java code over the years, and it's always sort of bugged me:
private static Logger logger = Logger.getLogger([class name].class.getName());
I�d like to be able to do �this.getClass().getName()�; that way if I ever decide to change the name of the class there�s one less line of code to worry about.
Is it just me, or does it seem like a deficiency in Java that should be corrected?
- Michael