Tabnine Logo
MonolineFormatter.install
Code IndexAdd Tabnine to your IDE (free)

How to use
install
method
in
org.apache.sis.util.logging.MonolineFormatter

Best Java code snippets using org.apache.sis.util.logging.MonolineFormatter.install (Showing top 5 results out of 315)

origin: org.apache.sis.core/sis-utility

/**
 * Installs a {@code MonolineFormatter} for the root logger, or returns the existing instance if any.
 * This method performs the following choices:
 *
 * <ul>
 *   <li>If a {@link ConsoleHandler} is associated to the root logger, then:
 *     <ul>
 *       <li>If that handler already uses a {@code MonolineFormatter}, then the existing formatter is returned.</li>
 *       <li>Otherwise the {@code ConsoleHandler} formatter is replaced by a new {@code MonolineFormatter} instance,
 *           and that new instance is returned. We perform this replacement in order to avoid sending twice the same
 *           records to the console.</li>
 *     </ul></li>
 *   <li>Otherwise a new {@code ConsoleHandler} using a new {@code MonolineFormatter} is created and added to the
 *       root logger.</li>
 * </ul>
 *
 * <div class="note"><b>Implementation note:</b>
 * The current implementation does not check for duplicated {@code ConsoleHandler} instances,
 * and does not check if any child logger has a {@code ConsoleHandler}.</div>
 *
 * @return the new or existing {@code MonolineFormatter}. The formatter output can be configured
 *         using the {@link #setTimeFormat(String)} and {@link #setSourceFormat(String)} methods.
 * @throws SecurityException if this method does not have the permission to install the formatter.
 */
@Configuration
public static MonolineFormatter install()  throws SecurityException {
  return install(Logging.getLogger(""), null);
}
origin: apache/sis

/**
 * Installs a {@code MonolineFormatter} for the root logger, or returns the existing instance if any.
 * This method performs the following choices:
 *
 * <ul>
 *   <li>If a {@link ConsoleHandler} is associated to the root logger, then:
 *     <ul>
 *       <li>If that handler already uses a {@code MonolineFormatter}, then the existing formatter is returned.</li>
 *       <li>Otherwise the {@code ConsoleHandler} formatter is replaced by a new {@code MonolineFormatter} instance,
 *           and that new instance is returned. We perform this replacement in order to avoid sending twice the same
 *           records to the console.</li>
 *     </ul></li>
 *   <li>Otherwise a new {@code ConsoleHandler} using a new {@code MonolineFormatter} is created and added to the
 *       root logger.</li>
 * </ul>
 *
 * <div class="note"><b>Implementation note:</b>
 * The current implementation does not check for duplicated {@code ConsoleHandler} instances,
 * and does not check if any child logger has a {@code ConsoleHandler}.</div>
 *
 * @return the new or existing {@code MonolineFormatter}. The formatter output can be configured
 *         using the {@link #setTimeFormat(String)} and {@link #setSourceFormat(String)} methods.
 * @throws SecurityException if this method does not have the permission to install the formatter.
 */
@Configuration
public static MonolineFormatter install() throws SecurityException {
  return install(Logging.getLogger(""), null);
}
origin: apache/sis

MonolineFormatter.install();
origin: Geomatys/geotoolkit

if ("server".equalsIgnoreCase(get(properties, "platform", "desktop"))) {
} else {
  MonolineFormatter.install();
origin: apache/sis

/**
 * Installs Apache SIS monoline formatter for easier identification of Apache SIS log messages among Maven outputs.
 * We perform this installation only for {@code *TestSuite}, not for individual {@code *Test}. Consequently this is
 * typically enabled when building a whole module with Maven but not when debugging an individual class.
 *
 * @since 1.0
 */
@BeforeClass
public static void configureLogging() {
  MonolineFormatter f = MonolineFormatter.install();
  f.setHeader(null);
  f.setTimeFormat(null);
  f.setSourceFormat("class.method");
}
org.apache.sis.util.loggingMonolineFormatterinstall

Javadoc

Installs a MonolineFormatter for the root logger, or returns the existing instance if any. This method performs the following choices:
  • If a ConsoleHandler is associated to the root logger, then:
    • If that handler already uses a MonolineFormatter, then the existing formatter is returned.
    • Otherwise the ConsoleHandler formatter is replaced by a new MonolineFormatter instance, and that new instance is returned. We perform this replacement in order to avoid sending twice the same records to the console.
  • Otherwise a new ConsoleHandler using a new MonolineFormatter is created and added to the root logger.
Implementation note: The current implementation does not check for duplicated ConsoleHandler instances, and does not check if any child logger has a ConsoleHandler.

Popular methods of MonolineFormatter

  • levelWidth
    Returns the length of the widest level name, taking in account only the standard levels equals or gr
  • <init>
    Constructs a default MonolineFormatter.Auto-configuration from the handler Formatters are often ass
  • colorAt
    Gets the color for the given level. If there is no explicit color for the given level, returns the c
  • colors
    Returns the #colors map, creating it if needed.
  • format
    Formats the given log record and return the formatted string. See the class javadoc for information
  • formatMessage
    Returns the localized message from the given log record. First this method gets the LogRecord#getMes
  • more
    Formats the number of stack trace elements that where skipped.
  • printAbridged
    Prints an abridged stack trace. This method is invoked when the record is logged at at low logging l
  • resetLevelColors
    Resets the colors setting to its default value. * If enabled is true, then this method defines a
  • setHeader
    Sets the string to write on the left side of the first line of every log records.
  • setSourceFormat
    Sets the format for displaying the source, or hides the source field. The given format can be any of
  • setTimeFormat
    Sets the format for elapsed time, or hides the time field. The pattern must matches the format speci
  • setSourceFormat,
  • setTimeFormat,
  • sourceFormat,
  • timeFormat

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Permission (java.security)
    Legacy security code; do not use.
  • Collectors (java.util.stream)
  • JFrame (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now