|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.util.DefaultLogProvider
public class DefaultLogProvider
If no log provider is registered with the log services, the default
provider will be used. The default provider simply logs messages to
System.err and manages log levels in a simplistic way.
Log,
LogProvider| Field Summary | |
|---|---|
protected SimpleDateFormat |
_format
Used to accompany log messages with time stamps. |
protected FieldPosition |
_fpos
Needed for the more efficient SimpleDateFormat.format(Date,StringBuffer,FieldPosition). |
protected int |
_level
The default log level. |
protected HashMap<String,Integer> |
_levels
The levels of each module. |
protected static Dimension |
_tdimens
Contains the dimensions of the terminal window in which we're running, if it was possible to obtain them. |
protected boolean |
_useVT100
Whether or not to use the vt100 escape codes. |
protected boolean |
_wrapLog
Whether or not to wrap the log lines. |
protected static String |
GAP
Used to align wrapped log lines. |
protected static String[] |
LEVEL_CHARS
Used to tag log messages with their log level. |
| Constructor Summary | |
|---|---|
DefaultLogProvider()
Constructs a default log provider. |
|
| Method Summary | |
|---|---|
protected String |
formatEntry(String moduleName,
int level,
String message)
|
int |
getLevel()
Returns the default log level for all modules. |
int |
getLevel(String moduleName)
Returns the log level for the specified module. |
void |
log(int level,
String moduleName,
String message)
Log a message at the specified level for the specified module, if messages are enabled for that particular combination. |
void |
logStackTrace(int level,
String moduleName,
Throwable t)
Log the stack trace of the supplied throwable at the specified level for the specified module, if messages are enabled for that particular combination. |
protected static void |
obtainTermSize()
Attempts to obtain the dimensions of the terminal window in which we're running. |
void |
setLevel(int level)
Set the log level for all modules to the specified level. |
void |
setLevel(String moduleName,
int level)
Set the log level for the specified module to the specified level. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int _level
protected HashMap<String,Integer> _levels
protected SimpleDateFormat _format
protected FieldPosition _fpos
SimpleDateFormat.format(Date,StringBuffer,FieldPosition).
protected static Dimension _tdimens
protected boolean _useVT100
protected boolean _wrapLog
protected static final String[] LEVEL_CHARS
protected static final String GAP
| Constructor Detail |
|---|
public DefaultLogProvider()
| Method Detail |
|---|
public void log(int level,
String moduleName,
String message)
LogProvider
log in interface LogProvider
public void logStackTrace(int level,
String moduleName,
Throwable t)
LogProvider
logStackTrace in interface LogProvider
public void setLevel(String moduleName,
int level)
LogProvider
setLevel in interface LogProviderpublic void setLevel(int level)
LogProvider
setLevel in interface LogProviderpublic int getLevel(String moduleName)
LogProvider
getLevel in interface LogProviderpublic int getLevel()
LogProvider
getLevel in interface LogProvider
protected String formatEntry(String moduleName,
int level,
String message)
protected static void obtainTermSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||