00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef JNILOGGER_H
00010 #define JNILOGGER_H
00011
00012 #include "JavaQxCommon.h"
00013
00014
00015
00016
00017
00024 class JAVAQX_EXPORT JNILogger
00025 {
00026 public:
00027 static void logInfo(const char *message, const char *fileName,
00028 int lineNumber);
00029 static void logInfo(const char *message);
00030 static void logWarning(const char *message, const char *fileName,
00031 int lineNumber);
00032 static void logWarning(const char *message);
00033 static void logError(const char *message, const char *fileName,
00034 int lineNumber);
00035 static void logError(const char *message);
00036 public:
00037 static void initialize(JNIEnv *env, jclass cls);
00038 private:
00039 static void log(int level, const char *message, const char *fileName,
00040 int lineNumber);
00041 private:
00042 static jclass sm_loggerClass;
00043 static jmethodID sm_logMID;
00044 };
00045
00046
00047
00048
00049
00050 #define LOG_INFO(message) JNILogger::logInfo(message, __FILE__, __LINE__)
00051 #define LOG_WARNING(message) JNILogger::logWarning(message, __FILE__, __LINE__)
00052 #define LOG_ERROR(message) JNILogger::logError(message, __FILE__, __LINE__)
00053
00054 #endif // JNILOGGER_H
00055
00056
00057
00058
00059
00060
00061
00062