Class Console
- All Implemented Interfaces:
ILoggerRedirector
The log file. Everything the IIZI Console shows (the IIZI log, System.out and System.err) is also written, same text and order, into a log file in a slot of LOG_DIR (iiziGo-console-1.log to iiziGo-console-10.log, the oldest or a missing one taken at each start, a slot a running iiziGo holds skipped: SlotLogFile). The feeder thread writes it, never the SWT thread, and flushes after each batch it drains; the texts the console view drops under a burst still reach the file. The file starts with a header (its own path, the start time, then the program info: the lines of the console view's first entry, "Program info:"), the last line of that entry names its path, and past LOG_MAX_SIZE the log continues in the next slot. The file is one static stream for the process (SlotLogFile.getCurrent()): it is not closed when the bundle stops or the console view is removed, only when a new log file is opened or by the end of the process; a bundle restart without a class reload finds the console's statics and the open file as they are, and reuses them (order CC-IIZIGO-CONSOLE-LOG-FILE, rulings L-1 to L-4).
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]Dark theme colors.static final int[]Light theme colors.static final FileThe directory of the console log files:<user home>/.iizi/com.iizigo/logs(ruling L-2), or the directoryLOG_DIR_PROPERTYnames.static final StringThe system property that names another directory for the console log files than the per-user folder.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intThe types.static final intMethod Summary
Modifier and TypeMethodDescriptionstatic voidPrints a stderr message.static FileGets the console's log file.static StringGets why file logging is off.static IPrintAdapterGets the printer to use for simple console output.voidonEventLogged(LogEntry entry) Called when an event is logged.static voidPrints to any of the stream types.static voidPrints a stdout message.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ILoggerRedirector
disposeAndFlush
Field Details
LOG_DIR_PROPERTY
The system property that names another directory for the console log files than the per-user folder. A test launch sets it (the Designer UI harness of com.iizigo.term.tests, in its pom), so that the slots of test runs do not take those of the user's own iiziGo: on a machine that runs both, the ten slots of the per-user folder were overwritten by test runs within hours. A relative path is resolved against the working directory. Not set or blank: the per-user folder, as for every iiziGo a user starts.- See Also:
LOG_DIR
The directory of the console log files:<user home>/.iizi/com.iizigo/logs(ruling L-2), or the directoryLOG_DIR_PROPERTYnames. Computed here rather than taken from the Activator: the console starts inside the Activator's static initializer, before its directories exist.TYPE_stderr
public static final int TYPE_stderrThe types.- See Also:
TYPE_stdout
public static final int TYPE_stdout- See Also:
TYPE_log_SEVERE
public static final int TYPE_log_SEVERE- See Also:
TYPE_log_WARNING
public static final int TYPE_log_WARNING- See Also:
TYPE_log_INFO
public static final int TYPE_log_INFO- See Also:
TYPE_log_CONFIG
public static final int TYPE_log_CONFIG- See Also:
TYPE_log_FINE
public static final int TYPE_log_FINE- See Also:
TYPE_log_FINER
public static final int TYPE_log_FINER- See Also:
TYPE_log_FINEST
public static final int TYPE_log_FINEST- See Also:
LIGHT_THEME_COLORS
public static final int[] LIGHT_THEME_COLORSLight theme colors.DARK_THEME_COLORS
public static final int[] DARK_THEME_COLORSDark theme colors.
Method Details
getPrintAdapter
Gets the printer to use for simple console output.- Returns:
- The instance.
getLogFile
Gets the console's log file.- Returns:
- The log file the console writes, or null when file logging is off (see
getLogFileFailure()).
getLogFileFailure
Gets why file logging is off.- Returns:
- The failure that stopped the file logging, or null when there is none.
onEventLogged
Called when an event is logged.- Specified by:
onEventLoggedin interfaceILoggerRedirector- Parameters:
entry- The log entry.
eprintln
Prints a stderr message.- Parameters:
msg- The message to print.
println
Prints a stdout message.- Parameters:
msg- The message to print.
println
Prints to any of the stream types.- Parameters:
type- The type of message:TYPE_stderr = 0 TYPE_stdout = 1 TYPE_log_SEVERE = 2 TYPE_log_WARNING = 3 TYPE_log_INFO = 4 TYPE_log_CONFIG = 5 TYPE_log_FINE = 6 TYPE_log_FINER = 7 TYPE_log_FINEST = 8
msg- The message to print.