mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
31.55.2014 6812cefe6168c6a6142a9633138c0f07ae135dd5
opendj3-server-dev/src/server/org/opends/server/loggers/ErrorLogger.java
@@ -121,20 +121,16 @@
  /**
   * Writes a message to the error log using the provided information.
   *
   * @param  message   The message to be logged.
   */
  // TODO : remove
  public static void logError(LocalizableMessage message)
  {
    log("category", Severity.SEVERE_ERROR, message, null);
  }
  /**
   * Writes a message to the error log using the provided information.
   * <p>
   * Category is defined using either short name (used for classes in well
   * defined packages) or fully qualified classname. Conversion to short name is
   * done automatically when loggers are created, see
   * {@code LoggingCategoryNames} for list of existing short names.
   *
   * @param category
   *          The category of the message.
   *          The category of the message, which is either a classname or a
   *          simple category name defined in {@code LoggingCategoryNames}
   *          class.
   * @param severity
   *          The severity of the message.
   * @param message
@@ -142,9 +138,9 @@
   * @param exception
   *          The exception to be logged. May be {@code null}.
   */
  public static void log(String category, Severity severity, LocalizableMessage message, Throwable exception)
  static void log(String category, Severity severity, LocalizableMessage message, Throwable exception)
  {
    for (ErrorLogPublisher publisher : loggerStorage.getLogPublishers())
    for (ErrorLogPublisher<?> publisher : loggerStorage.getLogPublishers())
    {
      publisher.log(category, severity, message, exception);
    }
@@ -164,12 +160,14 @@
   * Check if logging is enabled for the provided category and severity.
   *
   * @param category
   *            The category of logging event.
   *          The category of the logging event, which is either a classname or
   *          a simple category name defined in {@code LoggingCategoryNames}
   *          class.
   * @param severity
   *            The severity of logging event.
   *          The severity of logging event.
   * @return {@code true} if logger is enabled
   */
  public static boolean isEnabledFor(String category, Severity severity)
  static boolean isEnabledFor(String category, Severity severity)
  {
    if (Thread.currentThread() instanceof DirectoryThread)
    {
@@ -180,7 +178,7 @@
        return true;
      }
    }
    for (ErrorLogPublisher publisher : loggerStorage.getLogPublishers())
    for (ErrorLogPublisher<ErrorLogPublisherCfg> publisher : loggerStorage.getLogPublishers())
    {
      if (publisher.isEnabledFor(category, severity))
      {