Class LoggerTest

java.lang.Object
org.djutils.logger.LoggerTest

public class LoggerTest extends Object
LoggerTest.java.

Copyright (c) 2003-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
Author:
Alexander Verbraeck
  • Constructor Details

    • LoggerTest

      public LoggerTest()
  • Method Details

    • loggerTest

      @Test public final void loggerTest()
      Test whether Logger works correctly.
    • testAllLogLevels

      Test varying the logging level for the AllLogLevel levels.
      Throws:
      SecurityException - when a logging method can not be found (should not happen)
      NoSuchMethodException - when a logging method can not be found (should not happen)
      InvocationTargetException - when calling a logging method through reflection fails (should not happen)
      IllegalArgumentException - when calling a logging method through reflection fails (should not happen)
      IllegalAccessException - when calling a logging method through reflection fails (should not happen)
    • testWriterLogLevels

      Test varying the logging level per writer, when AllLogLevels is different. The way CategoryLogger has been set up, the Writer's log level should always take precedence of the default log level, independent on the relative ranking of the writer's log level and the default log level.
      Throws:
      SecurityException - when a logging method can not be found (should not happen)
      NoSuchMethodException - when a logging method can not be found (should not happen)
      InvocationTargetException - when calling a logging method through reflection fails (should not happen)
      IllegalArgumentException - when calling a logging method through reflection fails (should not happen)
      IllegalAccessException - when calling a logging method through reflection fails (should not happen)
    • testFilterOnCategories

      @Test public void testFilterOnCategories()
      Filter with multiple categories.
    • testAllLogMessageFormat

      @Test public void testAllLogMessageFormat()
      Test varying the default message format for all writers.
    • testWriterLogMessageFormat

      @Test public void testWriterLogMessageFormat()
      Test varying the message format for individual writers. The writer's message format always takes precedence over the default message format.