Fields Summary |
---|
public static int | REPORT_LEVELFlag allowing client code with reporting levels less
than this to be compiled out of the build. Callers
should use this flag as a way to remove bytecodes
related to unneeded levels of reporting from the
resulting classfiles.
For Example:
if (Logging.REPORT_LEVEL <= severity) {
Logging.report(Logging.<severity>,
LogChannels.<channel>,
"[meaningful message]");
}
|
public static boolean | ASSERT_ENABLEDFlag allowing client code with assert statements
to be compiled out of a production build. Clients of
the assertion service should wrap calls to the
assert() method to enable them to be
removed from builds when desired
if (Logging.ASSERT_ENABLED) {
Logging.assertTrue([eval to boolean], "message");
}
|
public static boolean | TRACE_ENABLEDFlag to indicate whether tracing is enabled in the
Logging service. If the flag is false ,
calls to the trace() method will have
no effect. Callers should use this flag as a type of
compile option to remove unnecessary bytecodes from
resulting classfiles.
For example:
} catch (Throwable t) {
if (Logging.TRACE_ENABLED) {
Logging.trace(t, "[meaningful message]");
}
}
|
Methods Summary |
---|
public static void | enableAsserts(int enabled)Enables or disables assertions.
if (enabled >= 0) {
ASSERT_ENABLED = (enabled > 0);
}
|
public static void | enableTrace(int enabled)Enables or disables tracing.
if (enabled >= 0) {
TRACE_ENABLED = (enabled > 0);
}
|
public static void | initLogSettings(int suiteId)Loads the logging settings for the specified suite.
/*
* IMPL_NOTE: parseMidpControlArg0() saves the parsed data into a global
* variables in native, it's not MVM-safe. But initLogSettings()
* is called during starting of a new midlet, and the situation when
* several midlets are started simultaneously is hardly ever possible.
*/
if (parseMidpControlArg0(suiteId)) {
setReportLevel(loadReportLevel0());
enableTrace(loadTraceEnabled0());
enableAsserts(loadAssertEnabled0());
}
|
private static native int | loadAssertEnabled0()Loads a value defining if assertions are enabled.
|
private static native int | loadReportLevel0()Loads a report level.
|
private static native int | loadTraceEnabled0()Loads a value defining if tracing is enabled.
|
private static native boolean | parseMidpControlArg0(int suiteId)Parses the value of MIDP_ARGS attribute set in the JAD file
of the given midlet suite.
|
public static void | setReportLevel(int newReportLevel)Sets a new report level.
if (newReportLevel != Constants.LOG_CURRENT) {
REPORT_LEVEL = newReportLevel;
}
|