July 28, 2004
Soft-coding the class's name

Ever since I started using log4j, it's irritated me that I'veneed to hard-code the package name in my Category log = Category.getInstance("package.name.here") statements, once in every class. Well, it turns out I don't; Pretty Log4J shows how to avoid hard-coding. ClassName.java lets me do Category log = Category.getInstance(ClassName.getPackageName()) - much nicer.

Posted to Java by Simon Brunning at July 28, 2004 02:18 PM
Comments
Post a comment
Name:


Email Address:


URL:



Comments:


Remember info?