hgcacheproxymodel/inc/hglogger.h
changeset 19 31a1a9e11046
parent 1 e48454f237ca
equal deleted inserted replaced
18:1591614dbf89 19:31a1a9e11046
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 *  Version     : %version: 1 %
    16 *  Version     : %version: 3 %
    17 */
    17 */
    18 #ifndef HGLOGGER_H_
    18 #ifndef HGLOGGER_H_
    19 #define HGLOGGER_H_
    19 #define HGLOGGER_H_
    20 
    20 
    21 //To enable tracking define ENABLETRACE
    21 //To enable tracking define ENABLETRACE
    34     #include <stdio.h>
    34     #include <stdio.h>
    35     #include <stdlib.h>
    35     #include <stdlib.h>
    36     #include <e32debug.h>
    36     #include <e32debug.h>
    37 
    37 
    38     #ifdef TRACE_FILE
    38     #ifdef TRACE_FILE
    39         #define _TRACE_FILENAME "c:/trace.txt"
    39 		#ifndef TRACE_FILENAME
       
    40 			#define TRACE_FILENAME "c:/trace.txt"
       
    41 		#endif
    40         #define _TX_INIT void __tx_myMessageOutput(QtMsgType type, const char *msg) {\
    42         #define _TX_INIT void __tx_myMessageOutput(QtMsgType type, const char *msg) {\
    41              static const QString timeFmt("hh:mm:ss.zzz");\
    43              static const QString timeFmt("hh:mm:ss.zzz");\
    42              FILE *f = fopen(_TRACE_FILENAME, "a");\
    44              FILE *f = fopen(TRACE_FILENAME, "a");\
    43              fprintf(f, "%s ", QTime::currentTime().toString(timeFmt).toLatin1().data() );\
    45              fprintf(f, "%s ", QTime::currentTime().toString(timeFmt).toLatin1().data() );\
    44              switch (type) {\
    46              switch (type) {\
    45              case QtDebugMsg: fprintf(f, "[DEB] [TX] %s\n", msg); break;\
    47              case QtDebugMsg: fprintf(f, "[DEB] [TX] %s\n", msg); break;\
    46              case QtWarningMsg: fprintf(f, "[WRN] [TX] %s\n", msg); break;\
    48              case QtWarningMsg: fprintf(f, "[WRN] [TX] %s\n", msg); break;\
    47              case QtCriticalMsg: fprintf(f, "[CRT] [TX] %s\n", msg); break;\
    49              case QtCriticalMsg: fprintf(f, "[CRT] [TX] %s\n", msg); break;\