Skip to content

Commit

Permalink
Added AnsiColorLogger and SilentLogger to the docs (phingofficial#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 authored and mrook committed Jun 4, 2018
1 parent 2af6bb9 commit ae3a174
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/guide/en/source/appendixes/coreloggers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,33 @@
</para>
</sect1>

<sect1 role="loggerdef" xml:id="AnsiColorLogger">
<title>AnsiColorLogger</title>
<para>The AnsiColorLogger adds color to the standard Phing output by prefixing and suffixing ANSI color code
escape sequences to it. It is just an extension of DefaultLogger and hence provides all features that
DefaultLogger does.</para>
<para>AnsiColorLogger differentiates the output by assigning different colors depending upon the type of the
message.</para>
<para>If used with the -logfile option, the output file will contain all the necessary escape codes to display
the text in colorized mode when displayed in the console using applications like cat, more, etc.</para>
<para>This is designed to work on terminals that support ANSI color codes.</para>
<para>If the user wishes to override the default colors with custom ones, a file containing zero or more of the
custom color key-value pairs must be created. The recognized keys and their default values are shown below:</para>
<programlisting>AnsiColorLogger.ERROR_COLOR=01;31
AnsiColorLogger.WARNING_COLOR=01;35
AnsiColorLogger.INFO_COLOR=00;36
AnsiColorLogger.VERBOSE_COLOR=00;32
AnsiColorLogger.DEBUG_COLOR=01;34</programlisting>
<para>Each key takes as value a color combination defined as "Attribute;Foreground;Background".
In the above example, background value has not been used.</para>
<para>This file must be specified as the value of a system variable named phing.logger.defaults and passed
as an argument using the -D option to the php command that invokes the Phing application.
An easy way to achieve this is to add -Dphing.logger.defaults=/path/to/your/file</para>
<para>
<literal>phing -logger "phing.listener.AnsiColorLogger"</literal>
</para>
</sect1>

<sect1 role="loggerdef" xml:id="MailLogger">
<title>MailLogger</title>
<para>The MailLogger captures all output logged through DefaultLogger
Expand Down Expand Up @@ -219,4 +246,9 @@
</para>
</sect1>

<sect1 role="loggerdef" xml:id="SilentLogger">
<title>SilentLogger</title>
<para>A logger which logs nothing but build failure and what task might output.</para>
</sect1>

</appendix>

0 comments on commit ae3a174

Please sign in to comment.