|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable jap.JAPDebug
public final class JAPDebug
This class serves as a debugging interface. It provides different debug types and levels for the output of debug messages.
The debug level can be set with
JAPDebug.setDebuglevel(int level)
.
The debug type can be set with
JAPDebug.setDebugType(int type)
.
To output a debug message use
JAPDebug.out(int level, int type, String txt)
This is a Singleton!
Field Summary | |
---|---|
private static java.text.SimpleDateFormat |
dateFormatter
|
private static JAPDebug |
debug
|
private static boolean |
m_bConsole
|
private int |
m_debugLevel
|
private int |
m_debugType
|
private static JAPDialog |
m_frameConsole
|
private static javax.swing.JTextArea |
m_textareaConsole
|
private java.awt.event.WindowAdapter |
m_winAdapter
|
private static boolean |
ms_bFile
|
private static FileLog |
ms_FileLog
|
private static java.lang.String |
ms_strFileName
|
Constructor Summary | |
---|---|
private |
JAPDebug()
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
finalize()
|
static JAPDebug |
getInstance()
|
static java.lang.String |
getLogFilename()
Returns the Filename log output goes to or null if logging to a File is disabled. |
int |
getLogLevel()
Get the current debug level. |
int |
getLogType()
Get the current debug type. |
void |
internal_showConsole(boolean b,
java.awt.Component parent)
|
static boolean |
isLogToFile()
|
static boolean |
isShowConsole()
|
void |
log(int level,
int type,
java.lang.String txt)
Output a debug message. |
private void |
saveLog()
|
void |
setLogLevel(int level)
Set the debugging level you would like to output. |
static void |
setLogToFile(java.lang.String strFilename)
Enables or disables log output to a File. |
void |
setLogType(int type)
Set the debugging type you like to output. |
static void |
showConsole(boolean b,
java.awt.Component parent)
Shows or hiddes a Debug-Console-Window |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int m_debugType
private int m_debugLevel
private static javax.swing.JTextArea m_textareaConsole
private static JAPDialog m_frameConsole
private static boolean m_bConsole
private static volatile boolean ms_bFile
private static java.lang.String ms_strFileName
private static FileLog ms_FileLog
private static JAPDebug debug
private static java.text.SimpleDateFormat dateFormatter
private java.awt.event.WindowAdapter m_winAdapter
Constructor Detail |
---|
private JAPDebug()
Method Detail |
---|
public void finalize()
finalize
in class java.lang.Object
public static JAPDebug getInstance()
public void log(int level, int type, java.lang.String txt)
log
in interface Log
level
- The level of the debugging message (EMERG,ALERT,CRIT,ERR,WARNING,NOTICE,INFO,DEBUG)type
- The type of the debugging message (GUI, NET, THREAD, MISC)txt
- The message itselfpublic void setLogType(int type)
setDebugType(JAPDebug.GUI+JAPDebug.NET)
.
setLogType
in interface Log
type
- The debug type (NUL, GUI, NET, THREAD, MISC)public int getLogType()
getLogType
in interface Log
public void setLogLevel(int level)
setLogLevel
in interface Log
level
- The debug level (EMERG, ALERT, EXCEPTION, ERR, WARNING, NOTICE, INFO, DEBUG)public int getLogLevel()
getLogLevel
in interface Log
public static void showConsole(boolean b, java.awt.Component parent)
b
- set true to show the debug console or false to hidde themparent
- the parent frame of the debug consolepublic static void setLogToFile(java.lang.String strFilename)
strFilename
- the Filename the logoutput should go to, if null (or the empty String "") log
to file is disabled.public static boolean isShowConsole()
public static boolean isLogToFile()
public static java.lang.String getLogFilename()
public void internal_showConsole(boolean b, java.awt.Component parent)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
private void saveLog()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |