gsprofilesrv_plat/controlpanel_api/inc/cplogger.h
changeset 61 33e86ecbfdb4
parent 52 58cebe0861a8
equal deleted inserted replaced
52:58cebe0861a8 61:33e86ecbfdb4
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors: 
       
    13 *
       
    14 * Description:  Log utility for controlpanel framework.
       
    15 *
       
    16 */
       
    17 #ifndef CPLOGGER_H
       
    18 #define CPLOGGER_H
       
    19 
       
    20 
       
    21 /* 
       
    22     config file path :/logconf/controlpanellog.conf
       
    23 
       
    24     Format:
       
    25 
       
    26     [CpFramework]
       
    27     logdatetime = 1
       
    28     logloggername = 1
       
    29     datetimeformat = hh:mm:ss:zzz
       
    30     output = debugoutput fileoutput
       
    31     fileoutput/logfile = C:/data/logs/cpframework.log
       
    32     fileoutput/truncate = 1
       
    33     
       
    34     [CpPerformance]
       
    35     logdatetime = 1
       
    36     datetimeformat = hh:mm:ss:zzz
       
    37     output = fileoutput
       
    38     fileoutput/logfile = C:/data/logs/cpperformance.log
       
    39     fileoutput/truncate = 1
       
    40 */
       
    41 
       
    42 #include <QLatin1String>
       
    43 #include <logger.h>
       
    44 
       
    45 /*
       
    46  define ENABLE_CPFW_LOG to  make CPFW_LOG work
       
    47 */
       
    48 
       
    49 //#define ENABLE_CPFW_LOG
       
    50 
       
    51 /*
       
    52  define ENABLE_CPPERF_LOG to make CPPERF_LOG work
       
    53 */
       
    54 
       
    55 //#define ENABLE_CPPERF_LOG
       
    56 
       
    57 #define CPFW_LOGGER_NAME       QLatin1String("CpFramework")
       
    58 #define CPPERF_LOGGER_NAME     QLatin1String("CpPerformance")
       
    59 
       
    60 #define CP_LOGGER_CONFIG_PATH QLatin1String(":/logconf/controlpanellog.conf")
       
    61 
       
    62 #ifdef ENABLE_CPFW_LOG
       
    63     #define CPFW_LOG(str)             Logger::instance(CPFW_LOGGER_NAME)->log(str);
       
    64     #define CPSP_LOG_FUNC_ENTRY(func) LogFunctionEntryHelper ___cpfw_log_func_entry_helper(CPFW_LOGGER_NAME,func);
       
    65 #else
       
    66     #define CPFW_LOG(str)
       
    67     #define CPSP_LOG_FUNC_ENTRY(func)
       
    68 #endif
       
    69 
       
    70 #ifdef ENABLE_CPPERF_LOG
       
    71     #define CPPERF_LOG(str) Logger::instance(CPPERF_LOGGER_NAME)->log(str);
       
    72 #else
       
    73     #define CPPERF_LOG(str)
       
    74 #endif
       
    75 
       
    76 #endif /* CPLOGGER_H */