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:
Michael Bayne
2011-10-05 15:53:41 -07:00
parent 07c5207f87
commit b3b2ca4926
2 changed files with 2 additions and 2 deletions
@@ -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");
+1 -1
View File
@@ -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");