bluetoothengine/btnotif/btnotifsrv/inc/traceconfig.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * ============================================================================
       
     3 *  Name        : traceconfig_template.h
       
     4 *  Part of     : BluetoothUI / bluetoothuimodel       *** Info from the SWAD
       
     5 *  Description : Configuration of debug tracing in btnotif
       
     6 *
       
     7 *  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     8 *  All rights reserved.
       
     9 *  This component and the accompanying materials are made available
       
    10 *  under the terms of "Eclipse Public License v1.0"
       
    11 *  which accompanies this distribution, and is available
       
    12 *  at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    13 *
       
    14 *  Initial Contributors:
       
    15 *  Nokia Corporation - initial contribution.
       
    16 *
       
    17 *  Contributors:
       
    18 *  Nokia Corporation
       
    19 * ============================================================================
       
    20 * Template version: 4.2
       
    21 */
       
    22 #ifndef BLUETOOTHTRACECONFIG_H
       
    23 #define BLUETOOTHTRACECONFIG_H
       
    24 
       
    25 /*
       
    26 Sample usage:
       
    27     void testTracing() 
       
    28     {
       
    29         BOstrace0( TRACE_FATAL, TNAME_DEVLIST_1, "BOstrace0" );
       
    30         BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_2, "BOstrace1 %d", 123 );
       
    31         _LIT(String, "\"Symbian Descriptor\"");
       
    32         TPtrC ptr(String);
       
    33         TBuf<20> buf(ptr);
       
    34         BOstraceExt1( TRACE_NORMAL, TNAME_DEVLIST_3, "BOstraceExt1 %S",  &ptr);
       
    35         BOstraceExt2( TRACE_API, TNAME_DEVLIST_4, "BOstraceExt2 %d %S", 456, &ptr );
       
    36         BOstraceExt3( TRACE_FLOW, TNAME_DEVLIST, "BOstraceExt3 0x%x %d %S", 128, 256, &ptr );
       
    37         BOstraceExt4( TRACE_DETAILED, TNAME_DEVL_5IST, "BOstraceExt4 0x%x %d %S %S", 128, 256, &ptr, &buf );
       
    38         BOstraceExt5( TRACE_DEBUG, TNAME_DEVLIST_6, "BOstraceExt5 0x%x %d %S %S, %b", 128, 256, &ptr, &buf, 512 );
       
    39         BOstraceFunctionEntry0( TNAME_DEVLIST_7 );
       
    40         BOstraceFunctionEntry1( TNAME_DEVLIST_8, 0x00abcdef );
       
    41         BOstraceFunctionEntryExt(TNAME_DEVLIST_9, 0xdeadbeef, 123);
       
    42         BOstraceFunctionExit0( TNAME_DEVLIST_9 );
       
    43         BOstraceFunctionExit1( TNAME_DEVLIST_10, 0x00beebee );
       
    44         BOstraceFunctionExitExt(TNAME_DEVLIST_11, 0x00badbed, -1);
       
    45         BOstraceEventStart0( TNAME_DEVLIST_12, "BOstraceEventStart0" );
       
    46         BOstraceEventStart1( TNAME_DEVLIST_13, "BOstraceEventStart1", 789 );
       
    47         BOstraceEventStop( TNAME_DEVLIST_14, "BOstraceEventStop" );
       
    48         BOstraceState0( TNAME_DEVLIST_15, "connection state", 1 );
       
    49         BOstraceState1( TNAME_DEVLIST_16, "audio state", 2, 0xdeadbeef );
       
    50         BtTraceBlock( 
       
    51                 for (int i = 0; i < 5; ++i) { 
       
    52                     BOstrace1( TRACE_IMPORTANT, TNAME_DEVLIST_, "BtTraceBlock counter(1-5): %d", i+1 );
       
    53                 });
       
    54         QString str("\"Qt String\"");
       
    55         BtTraceQString0( TRACE_NORMAL, TNAME_DEVLIST_17, str);
       
    56         BtTraceQString1( TRACE_NORMAL, TNAME_DEVLIST_18, "additional text;", str);
       
    57         TBTDevAddr addr;
       
    58         addr.SetReadable(_L("0060576ff376"));
       
    59         BtTraceBtAddr0( TRACE_NORMAL, TNAME_DEVLIST_19, addr );
       
    60         BtTraceBtAddr1( TRACE_NORMAL, TNAME_DEVLIST_20, "additional trace;", addr );
       
    61     }
       
    62 
       
    63  */
       
    64 
       
    65 // At early development phase, tracing is activated 
       
    66 #ifdef _DEBUG
       
    67 #define BLUETOOTHTRACE_ENABLED
       
    68 #endif //_DEBUG
       
    69 
       
    70 /*
       
    71  * Tracing media configuration
       
    72  */  
       
    73 #ifdef BLUETOOTHTRACE_ENABLED
       
    74     //#ifdef __WINS__
       
    75     //#define BLUETOOTHTRACE_MEDIA_FILE
       
    76     //#else 
       
    77     // RDEBUG is used for tracing output before we migrate to OST tracing.
       
    78     #define BLUETOOTHTRACE_MEDIA_RDEBUG
       
    79     // #define BLUETOOTHTRACE_MEDIA_OST 
       
    80     //#endif // __WINS__
       
    81 #endif //BLUETOOTHTRACE_ENABLED
       
    82 
       
    83 /*
       
    84  * Configuration of tracing to file
       
    85  */
       
    86 #ifdef BLUETOOTHTRACE_MEDIA_FILE
       
    87 
       
    88 _LIT( KLogFile, "btenglog.txt" );
       
    89 _LIT( KLogDir, "bt" );
       
    90 
       
    91 #endif //BLUETOOTHTRACE_MEDIA_FILE
       
    92 
       
    93 /*
       
    94  * Configuration of tracing using RDebug
       
    95  */
       
    96 #ifdef BLUETOOTHTRACE_MEDIA_RDEBUG
       
    97 
       
    98 #endif //BLUETOOTHTRACE_MEDIA_RDEBUG
       
    99 
       
   100 /*
       
   101  * Configuration of tracing using OST
       
   102  */
       
   103 #ifndef BLUETOOTHTRACE_MEDIA_OST
       
   104 
       
   105 /**
       
   106  * Group-mapping aligning with OST groups.
       
   107  * The purpose of using groups is to ease migrating tracing from legacy logging to OST.
       
   108  */
       
   109 #define TRACE_FATAL       "[FATAL]"
       
   110 #define TRACE_IMPORTANT   "[IMPTT]"
       
   111 #define TRACE_NORMAL      "[NORML]"
       
   112 #define TRACE_API         "[ API ]"
       
   113 #define TRACE_FLOW        "[FLOW ]"
       
   114 #define TRACE_STATE       "[STATE]"
       
   115 #define TRACE_DETAILED    "[DETLD]"
       
   116 #define TRACE_DEBUG       "[DEBUG]"
       
   117 #define TRACE_PERFORMANCE "[PFMAN]"
       
   118 
       
   119 /**
       
   120  * Component Identifier to be written into traces:
       
   121  */
       
   122 _LIT(KComponentName, "[BtNotif]");
       
   123 
       
   124 #endif //BLUETOOTHTRACE_MEDIA_OST
       
   125 
       
   126 #endif // BLUETOOTHTRACECONFIG_H