Java Doc for Log.java in  » Swing-Library » jEdit » org » gjt » sp » util » 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 » Swing Library » jEdit » org.gjt.sp.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.gjt.sp.util.Log

Log
public class Log (Code)
This class provides methods for logging events. In terms of functionality, it is somewhere in between System.out.println() and full-blown logging packages such as log4j.

All events are logged to an in-memory buffer and optionally a stream, and those with a high urgency (warnings and errors) are also printed to standard output.

Logging of exception tracebacks is supported.

This class can also optionally redirect standard output and error to the log.
author:
   Slava Pestov
version:
   $Id: Log.java 9135 2007-03-13 08:01:11Z Vampire0 $


Inner Class :static class LogListModel implements ListModel

Field Summary
final public static  intDEBUG
     Debugging message urgency.
final public static  intERROR
     Error urgency.
final public static  intMAXLINES
     The maximum number of log messages that will be kept in memory.
final public static  intMESSAGE
     Message urgency.
final public static  intNOTICE
     Notice urgency.
final public static  intWARNING
     Warning urgency.


Method Summary
public static  voidcloseStream()
     Closes the log stream.
public static  voidflushStream()
     Flushes the log stream.
public static  ListModelgetLogListModel()
     Returns the list model for viewing the log contents.
public static  voidinit(boolean stdio, int level)
     Initializes the log.
public static  voidlog(int urgency, Object source, Object message, Throwable exception)
     Logs an exception with a message.
public static  voidlog(int urgency, Object source, Object message)
     Logs a message.
public static  voidsetLogWriter(Writer stream)
     Writes all currently logged messages to this stream if there was no stream set previously, and sets the stream to write future log messages to.

Field Detail
DEBUG
final public static int DEBUG(Code)
Debugging message urgency. Should be used for messages only useful when debugging a problem.
since:
   jEdit 2.2pre2



ERROR
final public static int ERROR(Code)
Error urgency. Should be used for messages that signal a failure.
since:
   jEdit 2.2pre2



MAXLINES
final public static int MAXLINES(Code)
The maximum number of log messages that will be kept in memory.
since:
   jEdit 2.6pre5



MESSAGE
final public static int MESSAGE(Code)
Message urgency. Should be used for messages which give more detail than notices.
since:
   jEdit 2.2pre2



NOTICE
final public static int NOTICE(Code)
Notice urgency. Should be used for messages that directly affect the user.
since:
   jEdit 2.2pre2



WARNING
final public static int WARNING(Code)
Warning urgency. Should be used for messages that warrant attention.
since:
   jEdit 2.2pre2





Method Detail
closeStream
public static void closeStream()(Code)
Closes the log stream. Should be done before your program exits.
since:
   jEdit 2.6pre5



flushStream
public static void flushStream()(Code)
Flushes the log stream.
since:
   jEdit 2.6pre5



getLogListModel
public static ListModel getLogListModel()(Code)
Returns the list model for viewing the log contents.
since:
   jEdit 4.2pre1



init
public static void init(boolean stdio, int level)(Code)
Initializes the log.
Parameters:
  stdio - If true, standard output and error will besent to the log
Parameters:
  level - Messages with this log level or higher willbe printed to the system console
since:
   jEdit 3.2pre4



log
public static void log(int urgency, Object source, Object message, Throwable exception)(Code)
Logs an exception with a message. If an exception is the cause of a call to Log.log , then the exception should be explicitly provided so that it can be presented to the (debugging) user in a useful manner (not just the exception message, but also the exception stack trace)
since:
   jEdit 4.3pre5



log
public static void log(int urgency, Object source, Object message)(Code)
Logs a message. This method is thread-safe.

The following code sends a typical debugging message to the activity log:

Log.log(Log.DEBUG,this,"counter = " + counter);
The corresponding activity log entry might read as follows:
[debug] JavaParser: counter = 15

Parameters:
  urgency - The urgency; can be one ofLog.DEBUG, Log.MESSAGE,Log.NOTICE, Log.WARNING, orLog.ERROR.
Parameters:
  source - The source of the message, either an object or aclass instance. When writing log messages from macros, setthis parameter to BeanShell.class to make macroerrors easier to spot in the activity log.
Parameters:
  message - The message. This can either be a string oran exception
since:
   jEdit 2.2pre2



setLogWriter
public static void setLogWriter(Writer stream)(Code)
Writes all currently logged messages to this stream if there was no stream set previously, and sets the stream to write future log messages to.
Parameters:
  stream - The writer
since:
   jEdit 3.2pre4



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.