Java Doc for DefaultLogger.java in  » Build » ANT » org » apache » tools » ant » 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 » Build » ANT » org.apache.tools.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.DefaultLogger

All known Subclasses:   org.apache.tools.ant.listener.TimestampedLogger,  org.apache.tools.ant.listener.MailLogger,  org.apache.tools.ant.NoBannerLogger,  org.apache.tools.ant.listener.AnsiColorLogger,
DefaultLogger
public class DefaultLogger implements BuildLogger(Code)
Writes build events to a PrintStream. Currently, it only writes which targets are being executed, and any messages that get logged.


Field Summary
final public static  intLEFT_COLUMN_SIZE
     Size of left-hand column for right-justified task name.
protected  booleanemacsMode
    
protected  PrintStreamerr
    
final protected static  StringlSep
    
protected  intmsgOutputLevel
    
protected  PrintStreamout
    

Constructor Summary
public  DefaultLogger()
     Sole constructor.

Method Summary
public  voidbuildFinished(BuildEvent event)
     Prints whether the build succeeded or failed, any errors the occurred during the build, and how long the build took.
public  voidbuildStarted(BuildEvent event)
     Responds to a build being started by just remembering the current time.
protected static  StringformatTime(long millis)
     Convenience method to format a specified length of time.
Parameters:
  millis - Length of time to format, in milliseconds.
protected  StringgetBuildFailedMessage()
     This is an override point: the message that indicates whether a build failed.
protected  StringgetBuildSuccessfulMessage()
     This is an override point: the message that indicates that a build succeeded.
protected  voidlog(String message)
     Empty implementation which allows subclasses to receive the same output that is generated here.
Parameters:
  message - Message being logged.
public  voidmessageLogged(BuildEvent event)
     Logs a message, if the priority is suitable.
protected  voidprintMessage(String message, PrintStream stream, int priority)
     Prints a message to a PrintStream.
public  voidsetEmacsMode(boolean emacsMode)
     Sets this logger to produce emacs (and other editor) friendly output.
public  voidsetErrorPrintStream(PrintStream err)
     Sets the output stream to which this logger is to send error messages.
public  voidsetMessageOutputLevel(int level)
     Sets the highest level of message this logger should respond to. Only messages with a message level lower than or equal to the given level should be written to the log.

Constants for the message levels are in the Project Project class.

public  voidsetOutputPrintStream(PrintStream output)
     Sets the output stream to which this logger is to send its output.
public  voidtargetFinished(BuildEvent event)
     No-op implementation.
public  voidtargetStarted(BuildEvent event)
     Logs a message to say that the target has started if this logger allows information-level messages.
public  voidtaskFinished(BuildEvent event)
     No-op implementation.
public  voidtaskStarted(BuildEvent event)
     No-op implementation.

Field Detail
LEFT_COLUMN_SIZE
final public static int LEFT_COLUMN_SIZE(Code)
Size of left-hand column for right-justified task name.
See Also:   DefaultLogger.messageLogged(BuildEvent)



emacsMode
protected boolean emacsMode(Code)
Whether or not to use emacs-style output



err
protected PrintStream err(Code)
PrintStream to write error messages to



lSep
final protected static String lSep(Code)
Line separator



msgOutputLevel
protected int msgOutputLevel(Code)
Lowest level of message to write out



out
protected PrintStream out(Code)
PrintStream to write non-error messages to




Constructor Detail
DefaultLogger
public DefaultLogger()(Code)
Sole constructor.




Method Detail
buildFinished
public void buildFinished(BuildEvent event)(Code)
Prints whether the build succeeded or failed, any errors the occurred during the build, and how long the build took.
Parameters:
  event - An event with any relevant extra information.Must not be null.



buildStarted
public void buildStarted(BuildEvent event)(Code)
Responds to a build being started by just remembering the current time.
Parameters:
  event - Ignored.



formatTime
protected static String formatTime(long millis)(Code)
Convenience method to format a specified length of time.
Parameters:
  millis - Length of time to format, in milliseconds. the time as a formatted string.
See Also:   DateUtils.formatElapsedTime(long)



getBuildFailedMessage
protected String getBuildFailedMessage()(Code)
This is an override point: the message that indicates whether a build failed. Subclasses can change/enhance the message. The classic "BUILD FAILED"



getBuildSuccessfulMessage
protected String getBuildSuccessfulMessage()(Code)
This is an override point: the message that indicates that a build succeeded. Subclasses can change/enhance the message. The classic "BUILD SUCCESSFUL"



log
protected void log(String message)(Code)
Empty implementation which allows subclasses to receive the same output that is generated here.
Parameters:
  message - Message being logged. Should not be null.



messageLogged
public void messageLogged(BuildEvent event)(Code)
Logs a message, if the priority is suitable. In non-emacs mode, task level messages are prefixed by the task name which is right-justified.
Parameters:
  event - A BuildEvent containing message information.Must not be null.



printMessage
protected void printMessage(String message, PrintStream stream, int priority)(Code)
Prints a message to a PrintStream.
Parameters:
  message - The message to print.Should not be null.
Parameters:
  stream - A PrintStream to print the message to.Must not be null.
Parameters:
  priority - The priority of the message.(Ignored in this implementation.)



setEmacsMode
public void setEmacsMode(boolean emacsMode)(Code)
Sets this logger to produce emacs (and other editor) friendly output.
Parameters:
  emacsMode - true if output is to be unadorned so thatemacs and other editors can parse files names, etc.



setErrorPrintStream
public void setErrorPrintStream(PrintStream err)(Code)
Sets the output stream to which this logger is to send error messages.
Parameters:
  err - The error stream for the logger.Must not be null.



setMessageOutputLevel
public void setMessageOutputLevel(int level)(Code)
Sets the highest level of message this logger should respond to. Only messages with a message level lower than or equal to the given level should be written to the log.

Constants for the message levels are in the Project Project class. The order of the levels, from least to most verbose, is MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE, MSG_DEBUG.

The default message level for DefaultLogger is Project.MSG_ERR.
Parameters:
  level - the logging level for the logger.




setOutputPrintStream
public void setOutputPrintStream(PrintStream output)(Code)
Sets the output stream to which this logger is to send its output.
Parameters:
  output - The output stream for the logger.Must not be null.



targetFinished
public void targetFinished(BuildEvent event)(Code)
No-op implementation.
Parameters:
  event - Ignored.



targetStarted
public void targetStarted(BuildEvent event)(Code)
Logs a message to say that the target has started if this logger allows information-level messages.
Parameters:
  event - An event with any relevant extra information.Must not be null.



taskFinished
public void taskFinished(BuildEvent event)(Code)
No-op implementation.
Parameters:
  event - Ignored.



taskStarted
public void taskStarted(BuildEvent event)(Code)
No-op implementation.
Parameters:
  event - Ignored.



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.