32
|
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 |
*
|
52
|
12 |
* Contributors:
|
32
|
13 |
*
|
52
|
14 |
* Description: Log utility for controlpanel framework.
|
32
|
15 |
*
|
|
16 |
*/
|
|
17 |
#ifndef CPLOGGER_H
|
|
18 |
#define CPLOGGER_H
|
|
19 |
|
|
20 |
|
|
21 |
/*
|
40
|
22 |
config file path :/logconf/controlpanellog.conf
|
32
|
23 |
|
|
24 |
Format:
|
|
25 |
|
34
|
26 |
[CpFramework]
|
32
|
27 |
logdatetime = 1
|
|
28 |
logloggername = 1
|
34
|
29 |
datetimeformat = hh:mm:ss:zzz
|
32
|
30 |
output = debugoutput fileoutput
|
34
|
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
|
32
|
40 |
*/
|
|
41 |
|
|
42 |
#include <QLatin1String>
|
|
43 |
#include <logger.h>
|
|
44 |
|
40
|
45 |
/*
|
52
|
46 |
define ENABLE_CPFW_LOG to make CPFW_LOG work
|
40
|
47 |
*/
|
|
48 |
|
|
49 |
//#define ENABLE_CPFW_LOG
|
|
50 |
|
|
51 |
/*
|
52
|
52 |
define ENABLE_CPPERF_LOG to make CPPERF_LOG work
|
40
|
53 |
*/
|
|
54 |
|
|
55 |
//#define ENABLE_CPPERF_LOG
|
|
56 |
|
34
|
57 |
#define CPFW_LOGGER_NAME QLatin1String("CpFramework")
|
|
58 |
#define CPPERF_LOGGER_NAME QLatin1String("CpPerformance")
|
32
|
59 |
|
40
|
60 |
#define CP_LOGGER_CONFIG_PATH QLatin1String(":/logconf/controlpanellog.conf")
|
|
61 |
|
|
62 |
#ifdef ENABLE_CPFW_LOG
|
52
|
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);
|
40
|
65 |
#else
|
|
66 |
#define CPFW_LOG(str)
|
52
|
67 |
#define CPSP_LOG_FUNC_ENTRY(func)
|
32
|
68 |
#endif
|
|
69 |
|
40
|
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
|
32
|
75 |
|
|
76 |
#endif /* CPLOGGER_H */
|