|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILogCallback
General P4Java-wide logger callback interface. Designed to be used by consumers to receive logging events from the P4Java classes and methods; these can then be logged appropriately in the consumer's own log(s) or reported in a popup, etc.
Logging messages can range from mundane reports of connection startup and shutdown to detailed exception and tracing events, and consumers should plan accordingly. In particular, tracing events should only be enabled when you are debugging P4Java in conjunction with Perforce staff (unless you want to cope with enormous log files...); info and stats messages are entirely optional but might be useful for your own tracing purposes; warnings and errors should always be logged, as P4Java only uses these for things it regards as possible signs of something going wrong ahead of time (warnings), or real errors.
Note that there is only one such listener per instance of P4Java, which effectively means per server factory instance rather than per IServer.
Note also that the format of the strings reported through this mechanism is not well-defined, and that the intention here is that the consumer should wrap the messages in their own logging formatting with date / time prepended, etc.
NOTE: you must ensure that there are no threading or reentrancy issues with your implementation of this interface, and that calling any of the methods here will not cause the caller (P4Java) to block or spend too much time processing the callback.
Nested Class Summary | |
---|---|
static class |
ILogCallback.LogTraceLevel
Defines the various trace levels available. |
Method Summary | |
---|---|
ILogCallback.LogTraceLevel |
getTraceLevel()
Return the trace level being used in the callback. |
void |
internalError(String errorString)
Report a P4Java-internal error. |
void |
internalException(Throwable thr)
Report an unexpected or otherwise interesting exception seen internally. |
void |
internalInfo(String infoString)
Report a P4Java-internal informational event. |
void |
internalStats(String statsString)
Report some P4Java-internal statistics. |
void |
internalTrace(ILogCallback.LogTraceLevel traceLevel,
String traceMessage)
Report an internal P4Java trace message at the passed-in trace level. |
void |
internalWarn(String warnString)
Report a P4Java-internal warning. |
Method Detail |
---|
void internalError(String errorString)
errorString
- non-null error string; may contain newlines.void internalException(Throwable thr)
thr
- non-null Throwable.void internalWarn(String warnString)
warnString
- non-null warning message; may contain newlines.void internalInfo(String infoString)
infoString
- non-null info message; may contain newlines.void internalStats(String statsString)
statsString
- non-null stats message; may contain newlines.void internalTrace(ILogCallback.LogTraceLevel traceLevel, String traceMessage)
traceLevel
- trace level for associated messagetraceMessage
- non-null trace message; may contain newlines.ILogCallback.LogTraceLevel getTraceLevel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |