Make the Log holders package-only.
They're an implementation detail, not an exported public API. It would be nice if Java allowed for package-plus-subpackage visibility. I'm tempted to just use a Log class per-package across the board, which would allow one to omit the import and use Log.log.info() which isn't half bad. It's certainly better than adding a static Logger field to every single class that uses logging, which is the "best practice" used by every other Java developer in the world.
This commit is contained in:
@@ -10,7 +10,7 @@ import com.samskivert.util.Logger;
|
||||
/**
|
||||
* Contains a reference to the log object used by this package.
|
||||
*/
|
||||
public class Log
|
||||
class Log
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log = Logger.getLogger("ooo-servlet-util");
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.samskivert.util.Logger;
|
||||
/**
|
||||
* Contains a reference to the log object used by this package.
|
||||
*/
|
||||
public class Log
|
||||
class Log
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log = Logger.getLogger("ooo-util");
|
||||
|
||||
Reference in New Issue
Block a user