Package be.gaudry.debug
Class ConsoleHelper
java.lang.Object
be.gaudry.debug.ConsoleHelper
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 Summary
Modifier and TypeMethodDescriptionstatic void
Deletes old application log files.static void
Logs some debugging informationgetLogs()
Allows you to retrieve a list of paths to the different log files from the application directorystatic void
Sets the console encoding.static void
registerMessageListener(Consumer<ProgressResult> listener)
Adds a listener that is interested in whether a new progress message is availablestatic void
removeMessageListener(Consumer<ProgressResult> listener)
Removes a listener that was interested in whether a new progress message is availablestatic void
Logs some information and notifies the messages listeners with the formated informationstatic void
writeTitle(String title)
Formats an information title and notifies the the messages listeners with the formated informationstatic void
writeTitle(String titleFormat, Object... args)
Formats an information title and notifies the the messages listeners with the formated information
-
Method Details
-
registerMessageListener
Adds a listener that is interested in whether a new progress message is available- Parameters:
listener
-- See Also:
removeMessageListener(Consumer)
-
removeMessageListener
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 warnlog
for more information about possible error. -
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
Logs some information and notifies the messages listeners with the formated information- Parameters:
info
- Information to log- See Also:
registerMessageListener(Consumer)
,removeMessageListener(Consumer)
-
debug
Logs some debugging information- Parameters:
info
- Information to log
-
writeTitle
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
Formats an information title and notifies the the messages listeners with the formated information- Parameters:
titleFormat
- A format stringargs
- 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)
-