Ejemplo n.º 1
0
void javautil_printf(int severity, int channelID, char *message, ...) {
    va_list list;
    va_start(list, message);
    javautil_vprintf(severity, channelID, -1, message, list);
    va_end(list);

}
Ejemplo n.º 2
0
/**
 * Report a message to the Logging service.  On the linux emulator
 * this will end up going to stdout.  On the Zaurus device it will
 * be written to a file.
 *
 * The <code>message</code> parameter is treated as a format
 * string to the standard C library call printf would be, with
 * conversion specifications (%s, %d, %c, etc) causing the
 * conversion and output of each successive argument after
 * <code>message</code>  As with printf, having a conversion
 * character in <code>message</code> without an associated argument
 * following it is an error.
 *
 * To ensure that no character in <code>message</code> is
 * interpreted as requiring conversion, a safe way to call
 * this method is:
 * <code> reportToLog(severity, chanID, "%s", message); </code>

 * @param severity severity level of report
 * @param channelID area report relates to, from midp_constants_data.h
 * @param message detail message to go with the report
 *                should not be NULL
 */
void reportToLog(int severity, int channelID, char* message, ...) {
    va_list ap;
    
    if(message == NULL) {
        return;
    }

    if(get_allowed_severity_c(channelID) <= severity) {
        va_start(ap, message);
        javautil_vprintf(severity, channelID, GET_ISOLATE_ID, message, ap);
        va_end(ap);
    }
}