javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swtlog.h
changeset 76 4ad59aaee882
parent 48 e0d6e9bd3ca7
equal deleted inserted replaced
69:773449708c84 76:4ad59aaee882
     1 /*******************************************************************************
     1 /*******************************************************************************
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved. This program and the accompanying materials
     3  * All rights reserved. This program and the accompanying materials
     4  * are made available under the terms of the Eclipse Public License v1.0
     4  * are made available under the terms of the Eclipse Public License v1.0
     5  * which accompanies this distribution, and is available at
     5  * which accompanies this distribution, and is available at
     6  * http://www.eclipse.org/legal/epl-v10.html
     6  * http://www.eclipse.org/legal/epl-v10.html
     7  *
     7  *
    12 #ifndef SWTLOG_H_
    12 #ifndef SWTLOG_H_
    13 #define SWTLOG_H_
    13 #define SWTLOG_H_
    14 
    14 
    15 #include <QString>
    15 #include <QString>
    16 #include <QTime>
    16 #include <QTime>
       
    17 #include "swtexport.h"
    17 
    18 
    18 // Un-comment the following line to enable JNI logging
    19 // Un-comment the following line to enable JNI logging
    19 //#define SWT_ENABLE_LOGGING
    20 //#define SWT_ENABLE_LOGGING
    20 
    21 
    21 namespace Java { namespace eSWT {
    22 namespace Java { namespace eSWT {
    62 // Macros for SWT component logging
    63 // Macros for SWT component logging
    63 //
    64 //
    64 
    65 
    65 #ifdef SWT_ENABLE_LOGGING
    66 #ifdef SWT_ENABLE_LOGGING
    66 
    67 
    67 #ifdef Q_CC_NOKIAX86
    68 // For some reason Symbian Q_FUNC_INFO doesn't use __LINE__ but "(line number unavailable)"
       
    69 #ifdef Q_OS_SYMBIAN
    68 #define SWT_FUNC_INFO (QString(__FILE__ ":") += QString::number(__LINE__)).toLatin1().data()
    70 #define SWT_FUNC_INFO (QString(__FILE__ ":") += QString::number(__LINE__)).toLatin1().data()
    69 #else
    71 #else
    70 #define SWT_FUNC_INFO Q_FUNC_INFO
    72 #define SWT_FUNC_INFO Q_FUNC_INFO
    71 #endif
    73 #endif
    72 
    74 
   124  * for different types of scope logs.  
   126  * for different types of scope logs.  
   125  */
   127  */
   126 class SwtScopeLog
   128 class SwtScopeLog
   127 {
   129 {
   128 public:
   130 public:
   129     SwtScopeLog( const char* aFunctionName, const SwtLogType& aEnterType, const SwtLogType& aExitType );
   131     SWTQT_EXPORT SwtScopeLog( const char* aFunctionName, const SwtLogType& aEnterType, const SwtLogType& aExitType );
   130     virtual ~SwtScopeLog();
   132     SWTQT_EXPORT virtual ~SwtScopeLog();
   131 protected:
   133 protected:
   132     SwtScopeLog();
   134     SwtScopeLog();
   133 private:
   135 private:
   134     QString* mFunctionName;
   136     QString* mFunctionName;
   135     SwtLogType mExitLogType;
   137     SwtLogType mExitLogType;