Java Doc for Log.java in  » Testing » abbot-1.0.1 » abbot » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » abbot 1.0.1 » abbot 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.Log

Log
public class Log (Code)
Various logging, assertion, and debug routines. Typical usage is to include the following code
 public static void main(String[] args) {
   args = Log.
Log.init(String[]) init (args)
   ...
 }
 
at an application's main entry point. This way the Log class can remove its options from the full set passed into the application. See the Log.init(String[]) Log.init method for initialization options.

General usage notes on public functions:

  • Log.warn(String)
    Programmer warnings; things that you think shouldn't be happening or indicate something might be wrong. Warnings typically mean "Something happened that I didn't expect would happen".

  • Log.log(String)
    Important information that might be needed for later reference; things the user or debugger might be interested in. By default, all messages go here. Logs are made available so that the customer may provide us with an accurate record of software activity.
    All warnings and failed assertions are written to the log. Debug statements are also written to log in non-release code.

  • Log.debug(String)
    Any messages which might be useful for debugging.

Per-class stack trace depth can be specified when adding a class, e.g. classname[:stack-depth].

Extraction of the stack trace and logging to file are performed on a separate thread to minimize performance impact due to filesystem delays. Use Log.setSynchronous(boolean) setSynchronous(false) if you want the output to be asynchronous with program execution.


author:
   twall@users.sf.net



Field Summary
final public static  intFULL_STACK
     Mnemonic to print all lines of a stack trace.
final public static  intNO_STACK
     No stack, just a message.

Constructor Summary
protected  Log()
     No instantiations.

Method Summary
public static  voidaddDebugClass(Class class1)
     Indicate that debug messages should be output for the given class.
public static  voidaddDebugClass(String className)
     Indicate the class name[:depth] to add to debug output.
public static  voidaddDebugClass(String className, int depth)
     Indicate that debug messages should be output for the given class.
public static  voidclearDebugClasses()
     Resets the lists of classes to debug and not debug to be empty, and turns debugAll off.
public static  voidclose()
    
public static  voiddebug(String event)
     Print a debug message.
public static  voiddebug(String event, int lines)
     Print a debug message with the given number of stack lines.
public static  voiddebug(Throwable thr)
     Use this to display debug output for expected or common exceptions.
public static  voiddebug(String m, Throwable e)
     Issue a debug statement regarding the given Throwable .
static  voidflush()
    
static  intgetClassStackDepth(String cname)
    
public static  StringgetHostName()
    
public static  PrintStreamgetLog()
    
public static  StringgetLogFilename()
    
public static  StringgetStack(int lines)
     Retrieve the given number of lines of the current stack, as a string.
public static  StringgetStack(Throwable t)
     Retrieve the full stack from the given Throwable, as a string.
public static  StringgetStack(int lines, Throwable thr)
     Retrieve the given number of lines of stack from the given Throwable, as a string.
public static  StringgetSystemInfo()
    
public static  String[]init(String[] args)
     Debug/log initialization, presumably from the command line.
public static  voidinitLogging(String filename)
     Enable log output to the given file.
public static  booleanisClassDebugEnabled(Class cls)
    
public static  booleanisClassDebugEnabled(String className)
    
public static  voidlog(Throwable thr)
     Log an exception.
public static  voidlog(String message, Throwable thr)
     Log an exception with a description.
public static  voidlog(String message)
     Log a message.
public static  booleanloggingInitialized()
    
public static  voidremoveDebugClass(String className)
    
public static  voidremoveDebugClass(Class class1)
     Indicate that debug messages should no longer be output for the given class.
public static  voidsetDebugStackDepth(int depth)
    
public static  voidsetDestination(PrintStream ps)
     Enable log output to the given PrintStream .
public static  voidsetEchoToConsole(boolean b)
     Set whether messages are echoed to the console in addition to the log.
public static  voidsetShowThreads(boolean b)
     Set whether to display the current thread of execution.
public static  voidsetSynchronous(boolean b)
     Set whether log output is synchronous with program execution.
public static  voidwarn(String message)
     Issue a programmer warning, which will include the source line of the warning.
public static  voidwarn(String message, Throwable e)
     Issue a programmer warning, which will include the source line of the warning.
public static  voidwarn(String message, int lines)
     Issue a programmer warning, which will include the source line of the warning, and a stack trace with up to the given number of lines.
public static  voidwarn(Throwable thr)
     Issue a programmer warning, which will include the source line of the original thrown object.

Field Detail
FULL_STACK
final public static int FULL_STACK(Code)
Mnemonic to print all lines of a stack trace.



NO_STACK
final public static int NO_STACK(Code)
No stack, just a message.




Constructor Detail
Log
protected Log()(Code)
No instantiations.




Method Detail
addDebugClass
public static void addDebugClass(Class class1)(Code)
Indicate that debug messages should be output for the given class.



addDebugClass
public static void addDebugClass(String className)(Code)
Indicate the class name[:depth] to add to debug output.



addDebugClass
public static void addDebugClass(String className, int depth)(Code)
Indicate that debug messages should be output for the given class.



clearDebugClasses
public static void clearDebugClasses()(Code)
Resets the lists of classes to debug and not debug to be empty, and turns debugAll off.



close
public static void close()(Code)



debug
public static void debug(String event)(Code)
Print a debug message.



debug
public static void debug(String event, int lines)(Code)
Print a debug message with the given number of stack lines.



debug
public static void debug(Throwable thr)(Code)
Use this to display debug output for expected or common exceptions.



debug
public static void debug(String m, Throwable e)(Code)
Issue a debug statement regarding the given Throwable .



flush
static void flush()(Code)



getClassStackDepth
static int getClassStackDepth(String cname)(Code)



getHostName
public static String getHostName()(Code)



getLog
public static PrintStream getLog()(Code)



getLogFilename
public static String getLogFilename()(Code)



getStack
public static String getStack(int lines)(Code)
Retrieve the given number of lines of the current stack, as a string.



getStack
public static String getStack(Throwable t)(Code)
Retrieve the full stack from the given Throwable, as a string.



getStack
public static String getStack(int lines, Throwable thr)(Code)
Retrieve the given number of lines of stack from the given Throwable, as a string.



getSystemInfo
public static String getSystemInfo()(Code)



init
public static String[] init(String[] args)(Code)
Debug/log initialization, presumably from the command line.
Recognized options:
 --debug all | className[:depth] | *.partialClassName[:depth]
 --no-debug className | *.partialClassName
 --log 
 --no-timestamp
 --enable-warnings
 --show-threads
 --stack-depth 
 --exception-depth 
 



initLogging
public static void initLogging(String filename)(Code)
Enable log output to the given file. A filename of "-" means stdout.



isClassDebugEnabled
public static boolean isClassDebugEnabled(Class cls)(Code)



isClassDebugEnabled
public static boolean isClassDebugEnabled(String className)(Code)



log
public static void log(Throwable thr)(Code)
Log an exception.



log
public static void log(String message, Throwable thr)(Code)
Log an exception with a description.



log
public static void log(String message)(Code)
Log a message.



loggingInitialized
public static boolean loggingInitialized()(Code)
Is log output enabled?



removeDebugClass
public static void removeDebugClass(String className)(Code)
Indicate that the given class should NOT be debugged (assuming --debug all)



removeDebugClass
public static void removeDebugClass(Class class1)(Code)
Indicate that debug messages should no longer be output for the given class.



setDebugStackDepth
public static void setDebugStackDepth(int depth)(Code)
Sets the debug stack depth to the given amount



setDestination
public static void setDestination(PrintStream ps)(Code)
Enable log output to the given PrintStream .



setEchoToConsole
public static void setEchoToConsole(boolean b)(Code)
Set whether messages are echoed to the console in addition to the log.



setShowThreads
public static void setShowThreads(boolean b)(Code)
Set whether to display the current thread of execution.



setSynchronous
public static void setSynchronous(boolean b)(Code)
Set whether log output is synchronous with program execution.



warn
public static void warn(String message)(Code)
Issue a programmer warning, which will include the source line of the warning.



warn
public static void warn(String message, Throwable e)(Code)
Issue a programmer warning, which will include the source line of the warning.



warn
public static void warn(String message, int lines)(Code)
Issue a programmer warning, which will include the source line of the warning, and a stack trace with up to the given number of lines.



warn
public static void warn(Throwable thr)(Code)
Issue a programmer warning, which will include the source line of the original thrown object.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.