java.lang.Object
org.autogui.base.log.GuiLogManager
org.autogui.base.log.GuiLogManagerConsole
the console based log-manager
-
Nested Class Summary
Nested classes/interfaces inherited from class org.autogui.base.log.GuiLogManager
GuiLogManager.LogOutputStream, GuiLogManager.LogPrintStream, GuiLogManager.LogStreamType, GuiLogManager.LogUncaughtHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
protected boolean
protected GuiLogEntry
protected PrintStream
protected boolean
Fields inherited from class org.autogui.base.log.GuiLogManager
manager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatBar
(double p) getErr()
getOut()
boolean
boolean
create an exception entry and show itcreate an active progress entry and show it.create a string entry and show it.void
setControlSequence
(boolean controlSequence) void
setOut
(PrintStream out) void
setShowStandard
(boolean showStandard) void
show
(GuiLogEntry e) update display of the entry.void
void
void
void
Methods inherited from class org.autogui.base.log.GuiLogManager
formatDuration, formatMessageLine, formatTime, get, getSystemErr, isSymbol, log, logFormat, logProgress, logString, replaceConsole, replaceUncaughtHandler, resetErr, resetOut, resetUncaughtHandler, setManager
-
Field Details
-
out
-
lastEntry
-
controlSequence
protected boolean controlSequence -
showStandard
protected boolean showStandard- Since:
- 1.1
-
barWidth
public static int barWidth
-
-
Constructor Details
-
GuiLogManagerConsole
public GuiLogManagerConsole()use currentSystem.err
-
GuiLogManagerConsole
-
-
Method Details
-
setOut
-
getOut
-
setControlSequence
public void setControlSequence(boolean controlSequence) - Parameters:
controlSequence
- if true, control code with CSI will be printed (default)
-
isControlSequence
public boolean isControlSequence() -
isShowStandard
public boolean isShowStandard()- Returns:
- showing string entries created by stdout redirection. default is true
- Since:
- 1.1
-
setShowStandard
public void setShowStandard(boolean showStandard) - Parameters:
showStandard
- if true, showing string entries created by stdout redirection- Since:
- 1.1
-
getErr
- Overrides:
getErr
in classGuiLogManager
-
logString
Description copied from class:GuiLogManager
create a string entry and show it.- Overrides:
logString
in classGuiLogManager
- Parameters:
str
- the string for the entryfromStandard
- whether the string come from the standard output (or error) redirection- Returns:
- the created log entry
-
showString
-
logError
Description copied from class:GuiLogManager
create an exception entry and show it- Overrides:
logError
in classGuiLogManager
- Parameters:
ex
- the exception- Returns:
- the created entry
-
showError
-
logProgress
Description copied from class:GuiLogManager
create an active progress entry and show it. the returned progress is determinate (isIndeterminate() == false), and notifies progress changes to the manager byGuiLogManager.updateProgress(GuiLogEntryProgress)
try (GuiLogEntryProgress p = manager.logProgress();) { for (...) { //those methods will cause a runtime-exception if the thread is interrupted. p.addValueP(0.01f) .setMessage("running ..."); ... //the running code can checks interruption if (Thread.interrupted()) { break; } ... } } catch (Exception ex) { ... }
- Overrides:
logProgress
in classGuiLogManager
- Returns:
- the created progress entry
-
showProgress
-
updateProgress
- Overrides:
updateProgress
in classGuiLogManager
-
show
Description copied from class:GuiLogManager
update display of the entry.- Overrides:
show
in classGuiLogManager
- Parameters:
e
- the displayed entry
-
formatDurationIndeterminate
-
formatBar
-