Class ConsoleHelper

java.lang.Object
be.gaudry.debug.ConsoleHelper

public final class ConsoleHelper extends Object
Helps to show some informations on a console. Provided by the broldev.core.model project.
Since:
1.0 Aug 22, 2008, broldev.core.model 0.1.17 dependency
Version:
1.4 Jul 20, 2009
Author:
Steph GAUDRY
  • Method Details

    • registerMessageListener

      public static void registerMessageListener(Consumer<ProgressResult> listener)
      Adds a listener that is interested in whether a new progress message is available
      Parameters:
      listener -
      See Also:
      removeMessageListener(Consumer)
    • removeMessageListener

      public static void removeMessageListener(Consumer<ProgressResult> listener)
      Removes a listener that was interested in whether a new progress message is available
      Parameters:
      listener -
    • initConsole

      public static void initConsole()
      Sets the console encoding. Microsoft Windows command prompt use DOS (CP850) encoding, and all extended characters (i.e. èéàç...) are not well displayed. See the warn log for more information about possible error.
    • getLogs

      public static List<Path> getLogs()
      Allows you to retrieve a list of paths to the different log files from the application directory
      Returns:
      The list of paths to the different log files
    • cleanLogs

      public static void cleanLogs()
      Deletes old application log files. Warning: the log files in use will not be deleted.
    • writeLog

      public static void writeLog(String info)
      Logs some information and notifies the messages listeners with the formated information
      Parameters:
      info - Information to log
      See Also:
      registerMessageListener(Consumer), removeMessageListener(Consumer)
    • debug

      public static void debug(String info)
      Logs some debugging information
      Parameters:
      info - Information to log
    • writeTitle

      public static void writeTitle(String title)
      Formats an information title and notifies the the messages listeners with the formated information
      Parameters:
      title - Information to log
      See Also:
      registerMessageListener(Consumer), removeMessageListener(Consumer)
    • writeTitle

      public static void writeTitle(String titleFormat, Object... args)
      Formats an information title and notifies the the messages listeners with the formated information
      Parameters:
      titleFormat - A format string
      args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
      See Also:
      registerMessageListener(Consumer), removeMessageListener(Consumer), writeTitle(String)