sapi_logging/tsrc/dev/tloggingservice/src/tlogging.cpp
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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 the License "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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <e32svr.h>
       
    23 #include <e32std.h>
       
    24 #include <StifParser.h>
       
    25 #include <Stiftestinterface.h>
       
    26 #include <logcli.h>
       
    27 #include <logwrap.h>
       
    28 
       
    29 #include "loggingasyncservice.h"
       
    30 #include "loggingservice.h"
       
    31 #include "loggingfilter.h"
       
    32 #include "loggingevent.h"
       
    33 #include "tlogging.h"
       
    34 
       
    35 // EXTERNAL DATA STRUCTURES
       
    36 //extern  ?external_data;
       
    37 
       
    38 // EXTERNAL FUNCTION PROTOTYPES  
       
    39 //extern ?external_function( ?arg_type,?arg_type );
       
    40 
       
    41 // CONSTANTS
       
    42 //const ?type ?constant_var = ?constant;
       
    43 
       
    44 // MACROS
       
    45 //#define ?macro ?macro_def
       
    46 
       
    47 // LOCAL CONSTANTS AND MACROS
       
    48 //const ?type ?constant_var = ?constant;
       
    49 //#define ?macro_name ?macro_def
       
    50 
       
    51 // MODULE DATA STRUCTURES
       
    52 //enum ?declaration
       
    53 //typedef ?declaration
       
    54 
       
    55 // LOCAL FUNCTION PROTOTYPES
       
    56 //?type ?function_name( ?arg_type, ?arg_type );
       
    57 
       
    58 // FORWARD DECLARATIONS
       
    59 //class ?FORWARD_CLASSNAME;
       
    60 
       
    61 // ============================= LOCAL FUNCTIONS ===============================
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // ?function_name ?description.
       
    65 // ?description
       
    66 // Returns: ?value_1: ?description
       
    67 //          ?value_n: ?description_line1
       
    68 //                    ?description_line2
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 /*
       
    72 ?type ?function_name(
       
    73     ?arg_type arg,  // ?description
       
    74     ?arg_type arg)  // ?description
       
    75     {
       
    76 
       
    77     ?code  // ?comment
       
    78 
       
    79     // ?comment
       
    80     ?code
       
    81     }
       
    82 */
       
    83 
       
    84 // ============================ MEMBER FUNCTIONS ===============================
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // Ctlogging::Ctlogging
       
    88 // C++ default constructor can NOT contain any code, that
       
    89 // might leave.
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 Ctlogging::Ctlogging( 
       
    93     CTestModuleIf& aTestModuleIf ):
       
    94         CScriptBase( aTestModuleIf )
       
    95     {
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // Ctlogging::ConstructL
       
   100 // Symbian 2nd phase constructor can leave.
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 void Ctlogging::ConstructL()
       
   104     {
       
   105     iLog = CStifLogger::NewL( KtloggingLogPath, 
       
   106                           KtloggingLogFile,
       
   107                           CStifLogger::ETxt,
       
   108                           CStifLogger::EFile,
       
   109                           EFalse );
       
   110 
       
   111     }
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 // Ctlogging::NewL
       
   115 // Two-phased constructor.
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 Ctlogging* Ctlogging::NewL( 
       
   119     CTestModuleIf& aTestModuleIf )
       
   120     {
       
   121     Ctlogging* self = new (ELeave) Ctlogging( aTestModuleIf );
       
   122 
       
   123     CleanupStack::PushL( self );
       
   124     self->ConstructL();
       
   125     CleanupStack::Pop();
       
   126 
       
   127     return self;
       
   128 
       
   129     }
       
   130 
       
   131 // Destructor
       
   132 Ctlogging::~Ctlogging()
       
   133     { 
       
   134 
       
   135     // Delete resources allocated from test methods
       
   136     Delete();
       
   137 
       
   138     // Delete logger
       
   139     delete iLog; 
       
   140 
       
   141     }
       
   142 
       
   143 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   144 
       
   145 // -----------------------------------------------------------------------------
       
   146 // LibEntryL is a polymorphic Dll entry point.
       
   147 // Returns: CScriptBase: New CScriptBase derived object
       
   148 // -----------------------------------------------------------------------------
       
   149 //
       
   150 EXPORT_C CScriptBase* LibEntryL( 
       
   151     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
       
   152     {
       
   153 
       
   154     return ( CScriptBase* ) Ctlogging::NewL( aTestModuleIf );
       
   155 
       
   156     }
       
   157 
       
   158 
       
   159 //  End of File