|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Report
This interface is the access to output Log- or report messages while running an application
to check its work.
In opposite to the LogMessage,
the report-interface doesn't use ident-numbers...
Dieses Interface dient zur Ausgabe von Reportmeldungen for kommandozeilenartige Abarbeitung.
This interface is usefull for reporting something (logfiles). It should be used in every algorithm routine
to support debugging without using an extra debugger. It may help to encircle problems.
date who change
2007-12-29 HartmutS some methods from mainCmd_ifc are displaced here.
Thus the Report interface is revalued to write some informations also to the display
with the capability to control the report levels for that in the implementation.
2006-01-07 HartmutS initial revision
| Field Summary | |
|---|---|
static int |
anytime
Deprecated. use instead Report.error or Report.errorDisplay |
static int |
debug
report level to indicate the report should be written to detect problems in software. |
static int |
error
report level to indicate the report should be written anytime and anyway. |
static int |
eventOrder
Deprecated. use instead Report.info or Report.infoDisplay |
static int |
exitSuccessfull
exit value to indicate not at all problems. |
static int |
exitUserAbort
exit value to indicate a unconditional abort of a process. |
static int |
exitWithArgumentError
exit value to indicate a parameter error, that is a programmers error mostly. |
static int |
exitWithErrors
exit value to indicate a error in the own process, at example due to failed data |
static int |
exitWithFileProblems
exit value to indicate a file error, typicall write to a read only file, write to a failed directory, file not exists and others. |
static int |
exitWithNotes
exit value to indicate the user should read something and medidate about. |
static int |
exitWithWarnings
exit value to indicate some warnings, but no fatal errors. |
static int |
fineDebug
report level to indicate all report should be written to detect problems in software with finely and heavyset reports. |
static int |
fineEventOrder
Deprecated. use instead Report.fineInfo or Report.infoDisplay |
static int |
fineInfo
report level to indicate the report should be written if a user is interested on the order of the events finely. |
static int |
info
report level to indicate the report should be written if a user is interested on notes of the progression of programm is working. |
static int |
interested
Deprecated. use instead Report.warning or Report.warningDisplay |
static int |
mNeverOutputToDisplay
Mask bit to indicate, do not write to display. |
static int |
mReportLevel
Mask for the in fact reportlevel, other bits may have another meaning. |
static int |
warning
report level to indicate the report should be written if a user is interested on warnings. |
| Method Summary | |
|---|---|
void |
flushReport()
Writes the content in the physical medium. |
int |
getExitErrorLevel()
get the errorLevel setted with setExitErrorLevel(). |
LogMessage |
getLogMessageOutputConsole()
Gets a LogMessage output. |
LogMessage |
getLogMessageOutputFile()
Gets a LogMessage output. |
int |
getReportLevel()
access to the level of report. |
int |
getReportLevelFromIdent(int ident)
gets the associated report level to a report identifier. |
void |
openReportfile(java.lang.String sFileReport,
boolean bAppendReport)
|
void |
report(int nLevel,
java.lang.String string)
report inside a line |
void |
report(java.lang.String sText,
java.lang.Exception exception)
report of a excpetion (in a new line) |
void |
reportln(int nLevel,
int nLeftMargin,
java.lang.String string)
report begins at a new a line with left margin |
void |
reportln(int nLevel,
java.lang.String string)
report begins at a new a line |
void |
setExitErrorLevel(int level)
set the exitErrorLevel of the maximum of given level of every call. |
void |
setReportLevelToIdent(int ident,
int nLevelActive)
Sets a dedicated level number to the known output priorities. |
void |
writeError(java.lang.String sError)
Writes an error line. |
void |
writeError(java.lang.String sError,
java.lang.Exception exception)
Writes an error line caused by an exception. |
void |
writeInfo(java.lang.String sInfo)
Appends an info to the end of the previous info, @see #writeInfoln. |
void |
writeInfoln(java.lang.String sInfo)
Writes an info line. |
void |
writeWarning(java.lang.String sError)
Writes an error line. |
| Field Detail |
|---|
static final int exitUserAbort
static final int exitWithArgumentError
static final int exitWithFileProblems
static final int exitWithErrors
static final int exitWithWarnings
static final int exitWithNotes
static final int exitSuccessfull
static final int error
static final int warning
static final int info
static final int fineInfo
static final int debug
static final int fineDebug
static final int mReportLevel
static final int mNeverOutputToDisplay
static final int anytime
static final int interested
static final int eventOrder
static final int fineEventOrder
| Method Detail |
|---|
void writeInfoln(java.lang.String sInfo)
sInfo - String to be written.void writeInfo(java.lang.String sInfo)
sInfo - String to be written.void writeWarning(java.lang.String sError)
sError - The error text, it should be without such hot spot words line "!!!WARNING!!!",
because the distinction in display should be done by the implementation of this method.
A good sample is writeErrorln("file is empty: " + sFileName);void writeError(java.lang.String sError)
sError - The error text, it should be without such hot spot words line "!!!ERROR!!!",
because the distinction in display should be done by the implementation of this method.
A good sample is writeErrorln("cannot create file: " + sFileName);
void writeError(java.lang.String sError,
java.lang.Exception exception)
sError - The error text, it should be without such hot spot words line "!!!ERROR!!!",
because the distinction in display should be done by the implementation of this method.
A good sample is writeErrorln("cannot create file: " + sFileName);exception - The catched Exception. The getMessage()-part of the exception is written after sError.
The stacktrace of the exception is written to report.
void openReportfile(java.lang.String sFileReport,
boolean bAppendReport)
throws java.io.FileNotFoundException
java.io.FileNotFoundException
void report(int nLevel,
java.lang.String string)
void reportln(int nLevel,
int nLeftMargin,
java.lang.String string)
nLevel - write the report only if the demand level is greater or equal.nLeftMargin - determins a left margin. First a new line is outputted, followed by '*' and spaces.string - String to write.
void reportln(int nLevel,
java.lang.String string)
nLevel - write the report only if the demand level is greater or equal.string - String to write.
void report(java.lang.String sText,
java.lang.Exception exception)
int getReportLevel()
void flushReport()
void setReportLevelToIdent(int ident,
int nLevelActive)
nLevel - The number identifying a dedicated level. This number should be greater than
the known priority levels, it means >= 10 or >=1000.
Use dedicated group of numbers for an application.nLevelActive - Ones of the known priotity levels Report.error to Report.fineDebug.
class MyModule
{ /**Define module-specific numbers to identify a level.
* The numbers should be define regarding a band of numbers in the application.
* /
static final int myReportLevel1 = 3500, myReportLevel2=3501;
void init()
{ setLevelActive(myReportLevel1, Report.info); //This reports should be outputted always
setLevelActive(myReportLevel2, Report.debug); //This reports are debug infos.
}
void processAnything()
{ report.reportln( myReportLevel1, "InfoText"); //It depends on the report level settings
report.reportln( myReportLevel2, "DebugText");//wether it is outputted or not.
}
LogMessage getLogMessageOutputConsole()
LogMessage getLogMessageOutputFile()
int getReportLevelFromIdent(int ident)
ident - The identifier.
void setExitErrorLevel(int level)
level - Errorlevel how defined in Report, 0 is the lowest level (successfull), >0 is worse.int getExitErrorLevel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||