📄 logging.html
字号:
<DL><DD>Logging configuration that applies only to Geotools packages.<P><DL></DL></DL><HR><A NAME="ALL"><!-- --></A><H3>ALL</H3><PRE>public static final <A HREF="../../../org/geotools/util/Logging.html" title="class in org.geotools.util">Logging</A> <B>ALL</B></PRE><DL><DD>Logging configuration that applied to all packages.<P><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Logging(java.lang.String)"><!-- --></A><H3>Logging</H3><PRE>public <B>Logging</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> root)</PRE><DL><DD>Creates an instance for the specified root package.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="forceMonolineConsoleOutput()"><!-- --></A><H3>forceMonolineConsoleOutput</H3><PRE>public void <B>forceMonolineConsoleOutput</B>() throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></PRE><DL><DD>Configures the default <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/ConsoleHandler.html" title="class or interface in java.util.logging">console handler</A> in order to log records on a single line instead of two lines. More specifically, for each <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/ConsoleHandler.html" title="class or interface in java.util.logging"><CODE>ConsoleHandler</CODE></A> using a <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>, this method replaces the simple formatter by an instance of <A HREF="../../../org/geotools/util/MonolineFormatter.html" title="class in org.geotools.util"><CODE>MonolineFormatter</CODE></A>. If no <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/ConsoleHandler.html" title="class or interface in java.util.logging"><CODE>ConsoleHandler</CODE></A> are found, then a new one is created. <p> Note that <A HREF="../../../org/geotools/util/MonolineFormatter.html" title="class in org.geotools.util"><CODE>MonolineFormatter</CODE></A> writes to the <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/System.html#out" title="class or interface in java.lang">standard output stream</A> instead of the <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/System.html#err" title="class or interface in java.lang">standard error stream</A>.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - is <A HREF="../../../org/geotools/util/Logging.html#redirectToCommonsLogging()"><CODE>redirectToCommonsLogging()</CODE></A> has been invoked.</DL></DD></DL><HR><A NAME="forceMonolineConsoleOutput(java.util.logging.Level)"><!-- --></A><H3>forceMonolineConsoleOutput</H3><PRE>public void <B>forceMonolineConsoleOutput</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> level) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></PRE><DL><DD>Same as <A HREF="../../../org/geotools/util/Logging.html#forceMonolineConsoleOutput()"><CODE>forceMonolineConsoleOutput()</CODE></A>, but additionnaly set an optional logging level. If the specified level is non-null, then all <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Handler.html" title="class or interface in java.util.logging"><CODE>Handler</CODE></A>s using the monoline formatter will be set to the specified level. <p> <b>Note:</b> Avoid this method as much as possible, since it overrides user's level setting. A user trying to configure his logging properties may find confusing to see his setting ignored.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - is <A HREF="../../../org/geotools/util/Logging.html#redirectToCommonsLogging()"><CODE>redirectToCommonsLogging()</CODE></A> has been invoked.</DL></DD></DL><HR><A NAME="redirectToCommonsLogging()"><!-- --></A><H3>redirectToCommonsLogging</H3><PRE>public boolean <B>redirectToCommonsLogging</B>()</PRE><DL><DD>Redirects <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/package-summary.html">Java logging</A> events to the Apache's <A HREF="http://jakarta.apache.org/commons/logging/">commons-logging</A> framework. <p> This method should be invoked again when the common-logging configuration change. For example if the <cite>Log4J</cite> configuration is dynamically changed at runtime, then this method should be invoked again. <p> If this method determines that commons-logging would redirect all log events to the java logging system, then this method do nothing and return .<P><DD><DL><DT><B>Returns:</B><DD> if the adapter has been installed or re-installed, or if this method did nothing.</DL></DD></DL><HR><A NAME="unexpectedException(java.util.logging.Logger, java.lang.Throwable)"><!-- --></A><H3>unexpectedException</H3><PRE>public static boolean <B>unexpectedException</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Logger.html" title="class or interface in java.util.logging">Logger</A> logger, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A> error)</PRE><DL><DD>Invoked when an unexpected error occurs. This method logs a message at the <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Level.html#WARNING" title="class or interface in java.util.logging"><CODE>WARNING</CODE></A> level to the specified logger. The originating class name and method name are inferred from the error stack trace, using the first <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/StackTraceElement.html" title="class or interface in java.lang">stack trace element</A> for which the class name is inside a package or sub-package of the logger name. For example if the logger name is , then this method will uses the first stack trace element where the fully qualified class name starts with or , but not .<P><DD><DL><DT><B>Parameters:</B><DD><CODE>logger</CODE> - Where to log the error.<DD><CODE>error</CODE> - The error that occured.<DT><B>Returns:</B><DD> if the error has been logged, or if the logger doesn't log anything at the <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Level.html#WARNING" title="class or interface in java.util.logging"><CODE>WARNING</CODE></A> level.</DL></DD></DL><HR><A NAME="unexpectedException(java.lang.String, java.lang.Class, java.lang.String, java.lang.Throwable)"><!-- --></A><H3>unexpectedException</H3><PRE>public static void <B>unexpectedException</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> paquet, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> classe, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> method, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A> error)</PRE><DL><DD>Invoked when an unexpected error occurs. This method logs a message at the <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Level.html#WARNING" title="class or interface in java.util.logging"><CODE>WARNING</CODE></A> level to the logger for the specified package name. The originating class name and method name can optionnaly be specified. If any of them is , then it will be inferred from the error stack trace as in <A HREF="../../../org/geotools/util/Logging.html#unexpectedException(java.util.logging.Logger, java.lang.Throwable)"><CODE>unexpectedException(Logger, Throwable)</CODE></A>. <p> Explicit value for class and method names are sometime preferred to automatic inference for the following reasons: <ul> <li><p>Automatic inference is not 100% reliable, since the Java Virtual Machine is free to omit stack frame in optimized code.</p></li> <li><p>When an exception occured in a private method used internally by a public method, we sometime want to log the warning for the public method instead, since the user is not expected to know anything about the existence of the private method. If a developper really want to know about the private method, the stack trace is still available anyway.</p></li> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>paquet</CODE> - The package where the error occurred, or . This information is used for fetching an appropriate <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Logger.html" title="class or interface in java.util.logging"><CODE>Logger</CODE></A> for logging the error.<DD><CODE>classe</CODE> - The class where the error occurred, or .<DD><CODE>method</CODE> - The method where the error occurred, or .<DD><CODE>error</CODE> - The error.<DT><B>Since:</B></DT> <DD>2.4</DD></DL></DD></DL><HR><A NAME="unexpectedException(java.lang.String, java.lang.String, java.lang.String, java.lang.Throwable)"><!-- --></A><H3>unexpectedException</H3><PRE>public static void <B>unexpectedException</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> paquet, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> classe, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> method, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A> error)</PRE><DL><DD>Same as <A HREF="../../../org/geotools/util/Logging.html#unexpectedException(java.lang.String, java.lang.Class, java.lang.String, java.lang.Throwable)"><CODE>unexpectedException(..., Class, ...)</CODE></A> except that the class name is specified as a string.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>paquet</CODE> - The package where the error occurred, or . This information is used for fetching an appropriate <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/logging/Logger.html" title="class or interface in java.util.logging"><CODE>Logger</CODE></A> for logging the error.<DD><CODE>classe</CODE> - The class where the error occurred, or .<DD><CODE>method</CODE> - The method where the error occurred, or .<DD><CODE>error</CODE> - The error.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" 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_bottom_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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Logging.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/geotools/util/LocalName.html" title="class in org.geotools.util"><B>PREV CLASS</B></A> <A HREF="../../../org/geotools/util/LRULinkedHashMap.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> <A HREF="Logging.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 1996-2007 <a href="http://www.geotools.org">Geotools</a>. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -