--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swtlog.h Wed Jun 23 18:07:10 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swtlog.h Tue Jul 06 14:10:26 2010 +0300
@@ -64,14 +64,20 @@
#ifdef SWT_ENABLE_LOGGING
+#ifdef Q_CC_NOKIAX86
+#define SWT_FUNC_INFO (QString(__FILE__ ":") += QString::number(__LINE__)).toLatin1().data()
+#else
+#define SWT_FUNC_INFO Q_FUNC_INFO
+#endif
+
// Logging of a JNI native method call, JNI functions have this
-#define SWT_LOG_JNI_CALL() SwtScopeLog __swtScopeLogger(Q_FUNC_INFO, SwtLogJNIEnter, SwtLogJNIExit)
+#define SWT_LOG_JNI_CALL() SwtScopeLog __swtScopeLogger(SWT_FUNC_INFO, SwtLogJNIEnter, SwtLogJNIExit)
// Logging of a function call other than the above
-#define SWT_LOG_FUNC_CALL() SwtScopeLog __swtScopeLogger(Q_FUNC_INFO, SwtLogFuncEnter, SwtLogFuncExit)
+#define SWT_LOG_FUNC_CALL() SwtScopeLog __swtScopeLogger(SWT_FUNC_INFO, SwtLogFuncEnter, SwtLogFuncExit)
// Logging of a scope other than function call
-#define SWT_LOG_SCOPE_CALL() SwtScopeLog __swtScopeLogger(Q_FUNC_INFO, SwtLogScopeEnter, SwtLogScopeExit)
+#define SWT_LOG_SCOPE_CALL() SwtScopeLog __swtScopeLogger(SWT_FUNC_INFO, SwtLogScopeEnter, SwtLogScopeExit)
// Logging of events
#define SWT_LOG_EVENT_1(format, field1) SwtDataLog::LogData(format, field1, SwtLogEvent)
@@ -112,14 +118,6 @@
// Log fatal error conditions, application will automatically terminate with return value 1 when using this
#define SWT_LOG_FATAL_1(format, field1) SwtDataLog::LogData(format, field1, SwtLogFatal)
-//
-// Macros for Graphics component logging
-//
-
-// Logging of a JNI native method call, JNI functions have this
-//#define GFX_LOG_JNI_CALL() SwtScopeLog __swtScopeLogger(Q_FUNC_INFO, GfxLogJNIEnter, GfxLogJNIExit)
-
-
/**
* A class implementing logging of entering and leaving a scope.
* Additional type parameter is added for doing run time variation
@@ -128,13 +126,13 @@
class SwtScopeLog
{
public:
- SwtScopeLog( const char* aFunctionName, const SwtLogType& aEnterType, const SwtLogType& aExitType );
- virtual ~SwtScopeLog();
+ SwtScopeLog( const char* aFunctionName, const SwtLogType& aEnterType, const SwtLogType& aExitType );
+ virtual ~SwtScopeLog();
protected:
- SwtScopeLog();
+ SwtScopeLog();
private:
- QString* mFunctionName;
- SwtLogType mExitLogType;
+ QString* mFunctionName;
+ SwtLogType mExitLogType;
};
/**
@@ -204,44 +202,44 @@
}
else
{
- qDebug( "%s %s %s: %s", SWT_LOG_TIMESTAMP, logComponentName, dataDescription, aLogEntry );
- }
+ qDebug( "%s %s %s: %s", SWT_LOG_TIMESTAMP, logComponentName, dataDescription, aLogEntry );
+ }
+ }
+
+ template<class T1>
+ void LogData( const char* format, const T1& data1, const SwtLogType& type )
+ {
+ QString str;
+ DoLog( str.sprintf( format, data1 ).toLatin1().data(), type );
+ }
+
+ template<class T1, class T2>
+ void LogData( const char* format, const T1& data1, const T2& data2, const SwtLogType& type )
+ {
+ QString str;
+ DoLog( str.sprintf( format, data1, data2 ).toLatin1().data(), type );
}
- template<class T1>
- void LogData( const char* format, const T1& data1, const SwtLogType& type )
- {
- QString str;
- DoLog( str.sprintf( format, data1 ).toLatin1().data(), type );
- }
-
- template<class T1, class T2>
- void LogData( const char* format, const T1& data1, const T2& data2, const SwtLogType& type )
- {
- QString str;
- DoLog( str.sprintf( format, data1, data2 ).toLatin1().data(), type );
- }
-
- template<class T1, class T2, class T3>
- void LogData( const char* format, const T1& data1, const T2& data2, const T3& data3, const SwtLogType& type )
- {
- QString str;
- DoLog( str.sprintf( format, data1, data2, data3 ).toLatin1().data(), type );
- }
-
- template<class T1, class T2, class T3, class T4>
- void LogData( const char* format, const T1& data1, const T2& data2, const T3& data3, const T4& data4, const SwtLogType& type )
- {
- QString str;
- DoLog( str.sprintf( format, data1, data2, data3, data4 ).toLatin1().data(), type );
- }
-
- template<class T1, class T2, class T3, class T4, class T5>
- void LogData( const char* format, const T1& data1, const T2& data2, const T3& data3, const T4& data4, const T5& data5, const SwtLogType& type )
- {
- QString str;
- DoLog( str.sprintf( format, data1, data2, data3, data4, data5 ).toLatin1().data(), type );
- }
+ template<class T1, class T2, class T3>
+ void LogData( const char* format, const T1& data1, const T2& data2, const T3& data3, const SwtLogType& type )
+ {
+ QString str;
+ DoLog( str.sprintf( format, data1, data2, data3 ).toLatin1().data(), type );
+ }
+
+ template<class T1, class T2, class T3, class T4>
+ void LogData( const char* format, const T1& data1, const T2& data2, const T3& data3, const T4& data4, const SwtLogType& type )
+ {
+ QString str;
+ DoLog( str.sprintf( format, data1, data2, data3, data4 ).toLatin1().data(), type );
+ }
+
+ template<class T1, class T2, class T3, class T4, class T5>
+ void LogData( const char* format, const T1& data1, const T2& data2, const T3& data3, const T4& data4, const T5& data5, const SwtLogType& type )
+ {
+ QString str;
+ DoLog( str.sprintf( format, data1, data2, data3, data4, data5 ).toLatin1().data(), type );
+ }
}
}}