monolineformatter.html

来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 570 行 · 第 1/2 页

HTML
570
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2_13) on Tue Jun 05 11:36:17 GMT-05:00 2007 --><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><TITLE>MonolineFormatter (Geotools 2.3.x 2.3.2 API)</TITLE><META NAME="keywords" CONTENT="org.geotools.util.MonolineFormatter class"><META NAME="keywords" CONTENT="setTimeFormat()"><META NAME="keywords" CONTENT="getTimeFormat()"><META NAME="keywords" CONTENT="setSourceFormat()"><META NAME="keywords" CONTENT="getSourceFormat()"><META NAME="keywords" CONTENT="format()"><META NAME="keywords" CONTENT="init()"><META NAME="keywords" CONTENT="initGeotools()"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="MonolineFormatter (Geotools 2.3.x 2.3.2 API)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MonolineFormatter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../org/geotools/util/MapEntry.html" title="class in org.geotools.util"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/geotools/util/NameFactory.html" title="class in org.geotools.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="MonolineFormatter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.geotools.util</FONT><BR>Class MonolineFormatter</H2><PRE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>  <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Formatter.html" title="class or interface in java.util.logging">Formatter</A>      <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>MonolineFormatter</B></PRE><HR><DL><DT>public class <B>MonolineFormatter</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Formatter.html" title="class or interface in java.util.logging">Formatter</A></DL><P>A formatter writting log messages on a single line. This formatter is used by Geotools 2 instead of <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/SimpleFormatter.html" title="class or interface in java.util.logging"><CODE>SimpleFormatter</CODE></A>. The main difference is that this formatter use only one line per message instead of two. For example, a message formatted by  looks like: <blockquote><pre> FINE core - A log message logged with level FINE from the "org.geotools.core" logger. </pre></blockquote> By default,  display only the level and the message.  Additional fields can be formatted if <A HREF="../../../org/geotools/util/MonolineFormatter.html#setTimeFormat(java.lang.String)"><CODE>setTimeFormat(java.lang.String)</CODE></A> or <A HREF="../../../org/geotools/util/MonolineFormatter.html#setSourceFormat(java.lang.String)"><CODE>setSourceFormat(java.lang.String)</CODE></A> methods are invoked with a non-null argument. The format can also be set from the  file. For example, user can cut and paste the following properties into : <blockquote><pre> ############################################################ # Properties for the Geotools's MonolineFormatter. # By default, the monoline formatter display only the level # and the message. Additional fields can be specified here: # #   time:  If set, writes the time ellapsed since the initialization. #          The argument specifies the output pattern. For example, the #          pattern HH:mm:ss.SSSS display the hours, minutes, seconds #          and milliseconds. # #  source: If set, writes the source logger or the source class name. #          The argument specifies the type of source to display. Valid #          values are none, logger:short, logger:long, class:short and #          class:long. ############################################################ org.geotools.util.MonolineFormatter.time = HH:mm:ss.SSS org.geotools.util.MonolineFormatter.source = class:short </pre></blockquote> If the  is wanted for the whole system (not just the  packages) with level FINE (for example), then the following properties can be defined as below: <blockquote><pre> java.util.logging.ConsoleHandler.formatter = org.geotools.util.MonolineFormatter java.util.logging.ConsoleHandler.encoding = Cp850 java.util.logging.ConsoleHandler.level = FINE </pre></blockquote><P><P><DL><DT><B>Since:</B></DT>  <DD>2.0</DD><DT><B>Author:</B></DT>  <DD>Martin Desruisseaux</DD><DT><B>Module:</B></DT><DD><CODE><B>module/referencing</B></CODE> &nbsp; (<A HREF="http://maven.geotools.fr/repository/org/geotools/gt2-referencing/"><CODE>gt2-referencing.jar</CODE></A>) (<A HREF="http://maven.geotools.fr/reports/referencing/index.html">Maven report</A>) (<A HREF="http://svn.geotools.org/geotools/tags/2.3.2/module/referencing/src/org/geotools/util/MonolineFormatter.java">SVN head</A>)</DD></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#MonolineFormatter()">MonolineFormatter</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a default .</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#MonolineFormatter(java.lang.String)">MonolineFormatter</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;base)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a .</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#format(java.util.logging.LogRecord)">format</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/LogRecord.html" title="class or interface in java.util.logging">LogRecord</A>&nbsp;record)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Format the given log record and return the formatted string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#getSourceFormat()">getSourceFormat</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the format for displaying the source. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#getTimeFormat()">getTimeFormat</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the format for displaying ellapsed time. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/geotools/util/MonolineFormatter.html" title="class in org.geotools.util">MonolineFormatter</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#init(java.lang.String)">init</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;base)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Setup a  for the specified logger and its children.  </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/geotools/util/MonolineFormatter.html" title="class in org.geotools.util">MonolineFormatter</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#init(java.lang.String, java.util.logging.Level)">init</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;base,     <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Level.html" title="class or interface in java.util.logging">Level</A>&nbsp;level)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method setting both a  and the logger levels. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#initGeotools()">initGeotools</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialise the formatter for the "" loggers.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#initGeotools(java.util.logging.Level)">initGeotools</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Level.html" title="class or interface in java.util.logging">Level</A>&nbsp;level)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialise the formatter for the "" loggers with the specified level. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#setSourceFormat(java.lang.String)">setSourceFormat</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;format)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the format for displaying the source. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/util/MonolineFormatter.html#setTimeFormat(java.lang.String)">setTimeFormat</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;pattern)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the format for displaying ellapsed time. </TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_Formatter"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Formatter.html" title="class or interface in java.util.logging">Formatter</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Formatter.html#formatMessage(java.util.logging.LogRecord)" title="class or interface in java.util.logging">formatMessage</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Formatter.html#getHead(java.util.logging.Handler)" title="class or interface in java.util.logging">getHead</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Formatter.html#getTail(java.util.logging.Handler)" title="class or interface in java.util.logging">getTail</A></CODE></TD>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?